Изменил условие определения последнего движения

This commit is contained in:
brusnitsyn
2026-06-24 15:20:57 +09:00
parent 3012806fe0
commit 04110814b5

View File

@@ -33,7 +33,7 @@ class MedicalHistory extends MaterializedViewModel
public function latestMigration() public function latestMigration()
{ {
return $this->hasOne(MigrationPatient::class, 'medical_history_id', 'id') return $this->hasOne(MigrationPatient::class, 'medical_history_id', 'id')
->whereNotNull('out_date') ->whereNot('stationar_branch_id', 0) // не выписка
->latest('ingoing_date'); ->latest('ingoing_date');
} }