add test batches
This commit is contained in:
@@ -13,27 +13,27 @@ class ClassSectionQueryService
|
||||
->leftJoin('classes', 'classSection.class_id', '=', 'classes.id')
|
||||
->select('classSection.*', 'classes.class_name');
|
||||
|
||||
if (! empty($filters['search'])) {
|
||||
$term = '%'.strtolower((string) $filters['search']).'%';
|
||||
if (!empty($filters['search'])) {
|
||||
$term = '%' . strtolower((string) $filters['search']) . '%';
|
||||
$query->where(function ($q) use ($term) {
|
||||
$q->whereRaw('LOWER(classSection.class_section_name) LIKE ?', [$term])
|
||||
->orWhereRaw('LOWER(classes.class_name) LIKE ?', [$term]);
|
||||
});
|
||||
}
|
||||
|
||||
if (! empty($filters['class_id'])) {
|
||||
if (!empty($filters['class_id'])) {
|
||||
$query->where('classSection.class_id', (int) $filters['class_id']);
|
||||
}
|
||||
|
||||
if (! empty($filters['school_year'])) {
|
||||
if (!empty($filters['school_year'])) {
|
||||
$query->where('classSection.school_year', (string) $filters['school_year']);
|
||||
}
|
||||
|
||||
if (! empty($filters['semester'])) {
|
||||
if (!empty($filters['semester'])) {
|
||||
$query->where('classSection.semester', (string) $filters['semester']);
|
||||
}
|
||||
|
||||
if (! empty($filters['with_students'])) {
|
||||
if (!empty($filters['with_students'])) {
|
||||
$query->whereExists(function ($sub) use ($filters) {
|
||||
$sub->selectRaw('1')
|
||||
->from('student_class as sc')
|
||||
@@ -41,7 +41,7 @@ class ClassSectionQueryService
|
||||
->whereColumn('sc.class_section_id', 'classSection.class_section_id')
|
||||
->where('s.is_active', 1);
|
||||
|
||||
if (! empty($filters['school_year'])) {
|
||||
if (!empty($filters['school_year'])) {
|
||||
$sub->where('sc.school_year', (string) $filters['school_year']);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user