fix class progress admin side
This commit is contained in:
@@ -17,16 +17,19 @@ class ClassProgressGroupCollection extends ResourceCollection
|
||||
{
|
||||
$groups = [];
|
||||
foreach ($paginator->items() as $report) {
|
||||
$key = $report->week_start?->format('Y-m-d') ?? '';
|
||||
if ($key === '') {
|
||||
$weekStart = $report->week_start?->format('Y-m-d') ?? '';
|
||||
$sectionId = (int) ($report->class_section_id ?? 0);
|
||||
if ($weekStart === '' || $sectionId <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = $sectionId . '|' . $weekStart;
|
||||
|
||||
if (!isset($groups[$key])) {
|
||||
$groups[$key] = [
|
||||
'week_start' => $key,
|
||||
'week_start' => $weekStart,
|
||||
'week_end' => $report->week_end?->format('Y-m-d'),
|
||||
'class_section_id' => $report->class_section_id,
|
||||
'class_section_id' => $sectionId,
|
||||
'class_section_name' => $report->classSection?->class_section_name ?? '',
|
||||
'reports' => [],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user