GWM
This commit is contained in:
parent
0a96297e09
commit
808c196b83
@ -48,8 +48,10 @@ class EnquiryController extends ResourceController
|
||||
// Date filter handling
|
||||
if (empty($from_date) || empty($to_date)) {
|
||||
// Default last 7 days
|
||||
$from_date = date('Y-m-d 00:00:00', strtotime('-7 days'));
|
||||
$to_date = date('Y-m-d 23:59:59');
|
||||
// $from_date = date('Y-m-d 00:00:00', strtotime('-7 days'));
|
||||
// $to_date = date('Y-m-d 23:59:59');
|
||||
$from_date = null;
|
||||
$to_date = null;
|
||||
} else {
|
||||
// Convert d-m-Y → Y-m-d
|
||||
$from_date = DateTime::createFromFormat('d-m-Y', $from_date)->format('Y-m-d 00:00:00');
|
||||
|
||||
@ -291,6 +291,9 @@ class StaffController extends ResourceController
|
||||
$result[$key]['month'] = date('M Y', strtotime($value['month']));
|
||||
}
|
||||
|
||||
// Reindex array so JSON returns as an array, not an object
|
||||
$result = array_values($result);
|
||||
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'month' => $month, 'data' => $result], 200);
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user