Merge pull request #10919 from Godmartinz/gh10866-checkin_time_always_show_12am

Fixed #10866 - Checkin time always shows 12am
This commit is contained in:
snipe 2022-04-07 19:40:11 +01:00 committed by GitHub
commit b73542664b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -106,9 +106,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');
}
if(!empty($asset->licenseseats->all())){

View file

@ -115,6 +115,10 @@ trait Loggable
$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;
}