fix logic and tests, update docker CI file

This commit is contained in:
root
2026-03-09 15:58:44 -04:00
parent 1cb3573d4b
commit 79e44fe037
188 changed files with 1776 additions and 524 deletions
@@ -20,7 +20,14 @@ class AssignmentDataLoaderService
->with([
'teacher:id,firstname,lastname',
])
->when(filled($schoolYear), fn ($q) => $q->where('school_year', $schoolYear))
->when(
filled($schoolYear),
fn ($q) => $q->where(function ($query) use ($schoolYear) {
$query->where('school_year', $schoolYear)
->orWhereNull('school_year')
->orWhere('school_year', '');
})
)
->get()
->map(function ($row) {
$row->teacher_full_name = trim(
@@ -40,7 +47,14 @@ class AssignmentDataLoaderService
'student:id,firstname,lastname,age,gender,registration_grade,photo_consent,tuition_paid,school_id,is_active',
])
->whereHas('student', fn ($q) => $q->where('is_active', 1))
->when(filled($schoolYear), fn ($q) => $q->where('school_year', $schoolYear))
->when(
filled($schoolYear),
fn ($q) => $q->where(function ($query) use ($schoolYear) {
$query->where('school_year', $schoolYear)
->orWhereNull('school_year')
->orWhere('school_year', '');
})
)
->get();
}
}