Исправлен вывод всех пациентов если $reportIds = null
This commit is contained in:
@@ -39,7 +39,7 @@ class DutyMedicalHistoryService
|
||||
|
||||
// 1. Один запрос: получаем "сырые" данные (без вычисляемых статусов)
|
||||
$all = ReportDutyPatient::query()
|
||||
->when($reportIds, function ($query, $reportIds) {
|
||||
->when($reportIds !== null, function ($query) use ($reportIds) {
|
||||
return $query->whereIn('report_duty_id', $reportIds);
|
||||
})
|
||||
->whereHas('migrations', $periodMigrationFilter)
|
||||
|
||||
Reference in New Issue
Block a user