fix logic and tests, update docker CI file
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user