add test batches
This commit is contained in:
@@ -2,16 +2,13 @@
|
||||
|
||||
namespace App\Services\Parents;
|
||||
|
||||
use App\Controllers\ParentProgressController;
|
||||
use App\Http\Resources\ClassProgress\ClassProgressReportResource;
|
||||
use App\Models\ClassProgressReport;
|
||||
use App\Services\ClassProgress\ClassProgressQueryService;
|
||||
use Carbon\CarbonInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* legacy {@see ParentProgressController} read-side logic.
|
||||
* legacy {@see \App\Controllers\ParentProgressController} read-side logic.
|
||||
*/
|
||||
class ParentProgressQueryService
|
||||
{
|
||||
@@ -136,7 +133,7 @@ class ParentProgressQueryService
|
||||
$statusLabel = $statusOptions[$row->status] ?? 'Unknown';
|
||||
$row->setAttribute('status_label', $statusLabel);
|
||||
|
||||
$weekStart = $row->week_start instanceof CarbonInterface
|
||||
$weekStart = $row->week_start instanceof \Carbon\CarbonInterface
|
||||
? $row->week_start->format('Y-m-d')
|
||||
: (string) $row->week_start;
|
||||
$sectionId = (int) $row->class_section_id;
|
||||
@@ -148,7 +145,7 @@ class ParentProgressQueryService
|
||||
if (! isset($reportGroups[$key])) {
|
||||
$reportGroups[$key] = [
|
||||
'week_start' => $weekStart,
|
||||
'week_end' => $row->week_end instanceof CarbonInterface
|
||||
'week_end' => $row->week_end instanceof \Carbon\CarbonInterface
|
||||
? $row->week_end->format('Y-m-d')
|
||||
: (string) ($row->week_end ?? ''),
|
||||
'class_section_name' => $row->class_section_name ?? '',
|
||||
@@ -162,7 +159,7 @@ class ParentProgressQueryService
|
||||
continue;
|
||||
}
|
||||
|
||||
$reportGroups[$key]['reports'][$subject] = (new ClassProgressReportResource($row))->toArray(request());
|
||||
$reportGroups[$key]['reports'][$subject] = (new \App\Http\Resources\ClassProgress\ClassProgressReportResource($row))->toArray(request());
|
||||
}
|
||||
|
||||
return $reportGroups;
|
||||
|
||||
Reference in New Issue
Block a user