update
This commit is contained in:
@@ -114,6 +114,7 @@ class FrontpageController extends Controller
|
||||
if ($sisaMenit <= 60) {
|
||||
$earlyWarnings[] = [
|
||||
'id' => $row->id,
|
||||
'subpoli' => $row->subpoli ?? 'Tanpa Subpoli',
|
||||
'nofoto' => $row->nofoto,
|
||||
'noregister' => $row->noregister,
|
||||
'nmpasien' => $row->nmpasien,
|
||||
@@ -128,7 +129,21 @@ class FrontpageController extends Controller
|
||||
];
|
||||
}
|
||||
}
|
||||
$data['earlyWarnings'] = $earlyWarnings;
|
||||
$earlyWarningGroups = collect($earlyWarnings)
|
||||
->groupBy(function ($item) {
|
||||
return !empty($item['subpoli']) ? $item['subpoli'] : 'Tanpa Subpoli';
|
||||
})
|
||||
->map(function ($items, $subpoli) {
|
||||
return [
|
||||
'subpoli' => $subpoli,
|
||||
'total' => count($items),
|
||||
'items' => array_values($items->toArray()),
|
||||
];
|
||||
})
|
||||
->values()
|
||||
->toArray();
|
||||
|
||||
$data['earlyWarningGroups'] = $earlyWarningGroups;
|
||||
return view('dokter.dashborad', $data);
|
||||
} else {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user