Исправлен вывод всех пациентов если $reportIds = null
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user