fix class progress admin side
This commit is contained in:
@@ -33,6 +33,20 @@ class ClassSectionQueryService
|
||||
$query->where('classSection.semester', (string) $filters['semester']);
|
||||
}
|
||||
|
||||
if (!empty($filters['with_students'])) {
|
||||
$query->whereExists(function ($sub) use ($filters) {
|
||||
$sub->selectRaw('1')
|
||||
->from('student_class as sc')
|
||||
->join('students as s', 's.id', '=', 'sc.student_id')
|
||||
->whereColumn('sc.class_section_id', 'classSection.class_section_id')
|
||||
->where('s.is_active', 1);
|
||||
|
||||
if (!empty($filters['school_year'])) {
|
||||
$sub->where('sc.school_year', (string) $filters['school_year']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$sortBy = (string) ($filters['sort_by'] ?? 'class_section_name');
|
||||
$sortDir = strtolower((string) ($filters['sort_dir'] ?? 'asc')) === 'desc' ? 'desc' : 'asc';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user