fix is_active student flag and apply it in all pages
This commit is contained in:
@@ -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'])) {
|
||||
|
||||
Reference in New Issue
Block a user