This commit is contained in:
@@ -70,28 +70,6 @@ class AttendanceTrackingController extends BaseController
|
||||
->findAll();
|
||||
$debugInfo['class_students'] = count($classStudents);
|
||||
|
||||
// Fallback: if the configured school_year has no class assignments, look up the latest term
|
||||
if (empty($classStudents)) {
|
||||
$latestTerm = $this->db->table('student_class')
|
||||
->select('school_year, semester')
|
||||
->orderBy('id', 'DESC')
|
||||
->limit(1)
|
||||
->get()
|
||||
->getRowArray();
|
||||
|
||||
if ($latestTerm && !empty($latestTerm['school_year'])) {
|
||||
$schoolYear = (string)$latestTerm['school_year'];
|
||||
if (!empty($latestTerm['semester'])) {
|
||||
$semester = (string)$latestTerm['semester'];
|
||||
}
|
||||
|
||||
$classStudents = $this->studentClassModel
|
||||
->active()
|
||||
->where('student_class.school_year', $schoolYear)
|
||||
->findAll();
|
||||
}
|
||||
}
|
||||
|
||||
// Gather candidate student identifiers (numeric IDs and code-like IDs)
|
||||
$studentIds = [];
|
||||
$studentCodes = [];
|
||||
|
||||
Reference in New Issue
Block a user