This commit is contained in:
Gowtham M 2025-10-25 10:42:21 +05:30
parent 0a96297e09
commit 808c196b83
2 changed files with 7 additions and 2 deletions

View File

@ -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');

View File

@ -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);
}