fix gitlab tests
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ParentAttendanceReport extends BaseModel
|
||||
@@ -26,10 +27,10 @@ class ParentAttendanceReport extends BaseModel
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'parent_id' => 'integer',
|
||||
'student_id' => 'integer',
|
||||
'class_section_id' => 'integer',
|
||||
'report_date' => 'date',
|
||||
'parent_id' => 'integer',
|
||||
'student_id' => 'integer',
|
||||
'class_section_id'=> 'integer',
|
||||
'report_date' => 'date',
|
||||
];
|
||||
|
||||
/* Optional relationships */
|
||||
@@ -67,10 +68,10 @@ class ParentAttendanceReport extends BaseModel
|
||||
$q->where('par.parent_id', $parentId);
|
||||
}
|
||||
|
||||
if (! empty($startDate)) {
|
||||
if (!empty($startDate)) {
|
||||
$q->where('par.report_date', '>=', $startDate);
|
||||
}
|
||||
if (! empty($endDate)) {
|
||||
if (!empty($endDate)) {
|
||||
$q->where('par.report_date', '<=', $endDate);
|
||||
}
|
||||
if (is_string($schoolYear) && $schoolYear !== '') {
|
||||
@@ -81,12 +82,12 @@ class ParentAttendanceReport extends BaseModel
|
||||
}
|
||||
|
||||
$q->leftJoin('students as s', 's.id', '=', 'par.student_id')
|
||||
->leftJoin('classSection as cs', 'cs.class_section_id', '=', 'par.class_section_id')
|
||||
->select('par.*', 's.firstname', 's.lastname', 'cs.class_section_name')
|
||||
->orderBy('par.report_date', 'asc')
|
||||
->orderBy('par.class_section_id', 'asc')
|
||||
->orderBy('par.student_id', 'asc');
|
||||
->leftJoin('classSection as cs', 'cs.class_section_id', '=', 'par.class_section_id')
|
||||
->select('par.*', 's.firstname', 's.lastname', 'cs.class_section_name')
|
||||
->orderBy('par.report_date', 'asc')
|
||||
->orderBy('par.class_section_id', 'asc')
|
||||
->orderBy('par.student_id', 'asc');
|
||||
|
||||
return $q->get()->map(fn ($r) => (array) $r)->all();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user