From c5e8d1c276b653f638a8f3f106a80961293b6219 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 13 Feb 2024 17:09:51 -0500 Subject: [PATCH] custom report tinker --- app/Http/Controllers/ReportsController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 162469bcd2..b881396582 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -694,12 +694,13 @@ class ReportsController extends Controller } if (($request->filled('checkin_date_start'))) { - $assets->whereBetween('last_checkin', [ - Carbon::parse($request->input('checkin_date_start'))->startOfDay(), + $checkin_start = \Carbon::parse($request->input('checkin_date_start'))->startOfDay(); // use today's date is `checkin_date_end` is not provided - Carbon::parse($request->input('checkin_date_end', now()))->endOfDay(), - ]); + $checkin_end = \Carbon::parse($request->input('checkin_date_end', now()))->endOfDay(); + + $assets->whereBetween('assets.last_checkin', [$checkin_start, $checkin_end ]); } + //last checkin is exporting, but currently is a date and not a datetime in the custom report ONLY. if (($request->filled('expected_checkin_start')) && ($request->filled('expected_checkin_end'))) { $assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]);