|
|
@@ -230,11 +230,11 @@ private function attendance(array $unitIds, Carbon $startDate, Carbon $endDate):
|
|
|
})
|
|
|
->whereNull('u.deleted_at')
|
|
|
->when(!empty($unitIds), fn ($q) => $q->whereIn('u.id', $unitIds))
|
|
|
- ->groupBy('u.id', 'u.fantasy_name')
|
|
|
- ->orderBy('u.fantasy_name')
|
|
|
+ ->groupBy('u.id', 'u.name')
|
|
|
+ ->orderBy('u.name')
|
|
|
->get([
|
|
|
'u.id',
|
|
|
- 'u.fantasy_name',
|
|
|
+ 'u.name',
|
|
|
DB::raw('COUNT(ca.id) as attendance_count'),
|
|
|
DB::raw('SUM(CASE WHEN ca.in_class THEN 1 ELSE 0 END) as present_count'),
|
|
|
]);
|
|
|
@@ -252,7 +252,7 @@ private function attendance(array $unitIds, Carbon $startDate, Carbon $endDate):
|
|
|
|
|
|
return [
|
|
|
'id' => (int) $row->id,
|
|
|
- 'unit' => $row->fantasy_name,
|
|
|
+ 'unit' => $row->name,
|
|
|
'frequency' => $average,
|
|
|
'status' => $count === 0
|
|
|
? 'Sem dados'
|