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
+4 -4
View File
@@ -279,7 +279,7 @@ class TeacherClass extends BaseModel
->join('classSection as cs', 'cs.class_section_id', '=', 'tc.class_section_id')
->where('tc.teacher_id', $teacherId)
->where('tc.school_year', $schoolYear)
->orderByRaw("FIELD(tc.position,'main','ta')")
->orderByRaw("CASE tc.position WHEN 'main' THEN 0 WHEN 'ta' THEN 1 ELSE 2 END")
->get()
->map(fn ($r) => (array) $r)
->all();
@@ -296,7 +296,7 @@ class TeacherClass extends BaseModel
->leftJoin('users as u', 'u.id', '=', 'tc.teacher_id')
->where('tc.class_section_id', $sectionCode)
->where('tc.school_year', $schoolYear)
->orderByRaw("FIELD(tc.position,'main','ta')")
->orderByRaw("CASE tc.position WHEN 'main' THEN 0 WHEN 'ta' THEN 1 ELSE 2 END")
->orderBy('u.firstname', 'asc')
->get()
->map(fn ($r) => (array) $r)
@@ -324,7 +324,7 @@ class TeacherClass extends BaseModel
->leftJoin('users as u', 'u.id', '=', 'tc.teacher_id')
->where('tc.school_year', $schoolYear)
->orderBy('tc.class_section_id', 'asc')
->orderByRaw("FIELD(tc.position,'main','ta')")
->orderByRaw("CASE tc.position WHEN 'main' THEN 0 WHEN 'ta' THEN 1 ELSE 2 END")
->orderBy('u.firstname', 'asc');
if (!empty($onlySectionCodes)) {
@@ -360,4 +360,4 @@ class TeacherClass extends BaseModel
'updated_by' => ['nullable', 'integer'],
];
}
}
}