fix teacher pages display between school years
Tests / PHPUnit (push) Failing after 1m12s

This commit is contained in:
root
2026-07-15 20:52:19 -04:00
parent 5f27dccd0f
commit 9de2ab2a9f
9 changed files with 106 additions and 53 deletions
+19
View File
@@ -314,6 +314,25 @@ class StudentModel extends Model
->findAll();
}
public function getByParentAndYear(int $parentId, string $schoolYear): array
{
$schoolYear = trim($schoolYear);
if ($parentId <= 0 || $schoolYear === '') {
return [];
}
return $this->select('students.id, students.school_id, students.firstname, students.lastname')
->join('student_class', 'student_class.student_id = students.id', 'inner')
->where('students.parent_id', $parentId)
->where('students.is_active', 1)
->where('student_class.school_year', $schoolYear)
->groupBy('students.id, students.school_id, students.firstname, students.lastname')
->orderBy('students.lastname', 'ASC')
->orderBy('students.firstname', 'ASC')
->findAll();
}
public function getSchoolIdByStudentId($studentId)
{
return $this->select('school_id')