Исправлен вывод всех пациентов если $reportIds = null

This commit is contained in:
Brusnitsyn
2026-07-06 11:05:09 +00:00
parent 7ef20061f0
commit 587d9c7e58

View File

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