fixes action_date for check-in not including H:i:s

This commit is contained in:
Godfrey M 2022-04-07 11:24:12 -07:00
parent 0cb4caa4cf
commit 3eb7a87a66
2 changed files with 6 additions and 3 deletions

View file

@ -105,9 +105,9 @@ class AssetCheckinController extends Controller
$asset->location_id = e($request->get('location_id'));
}
$checkin_at = date('Y-m-d');
if($request->filled('checkin_at')){
$checkin_at = $request->input('checkin_at');
$checkin_at = date('Y-m-d H:i:s');
if (($request->filled('checkin_at')) && ($request->get('checkin_at') != date('Y-m-d'))) {
$checkin_at = $request->get('checkin_at');
}
// Was the asset updated?

View file

@ -116,6 +116,9 @@ trait Loggable
$log->location_id = null;
$log->note = $note;
$log->action_date = $action_date;
if (! $log->action_date) {
$log->action_date = date('Y-m-d H:i:s');
}
if (Auth::user()) {
$log->user_id = Auth::user()->id;