fix is_active student flag and apply it in all pages
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m17s

This commit is contained in:
root
2026-08-20 12:59:59 -04:00
parent 0a31aa1393
commit bfa343b69f
57 changed files with 820 additions and 240 deletions
@@ -386,12 +386,14 @@ class CompetitionScoresController extends BaseController
return 0;
}
$builder = $this->db->table($this->classStudentTable)
$builder = $this->db->table($this->classStudentTable . ' cs')
->select('COUNT(*) AS total')
->where('class_section_id', $classSectionId);
->join('students s', 's.id = cs.student_id', 'inner')
->where('cs.class_section_id', $classSectionId)
->where('s.is_active', 1);
if ($schoolYear && $this->db->fieldExists('school_year', $this->classStudentTable)) {
$builder->where('school_year', $schoolYear);
$builder->where('cs.school_year', $schoolYear);
}
$row = $builder->get()->getRowArray();
@@ -407,7 +409,8 @@ class CompetitionScoresController extends BaseController
$builder = $this->db->table('students s')
->select('s.id, s.school_id, s.firstname, s.lastname')
->join($this->classStudentTable . ' cs', 'cs.student_id = s.id', 'inner')
->where('cs.class_section_id', $classSectionId);
->where('cs.class_section_id', $classSectionId)
->where('s.is_active', 1);
$hasSchoolYear = $this->db->fieldExists('school_year', $this->classStudentTable);
if ($hasSchoolYear && !empty($competition['school_year'])) {