phases one of time logged now with log display

This commit is contained in:
Mark Gregory
2026-06-22 14:03:35 +01:00
parent fcd60471be
commit bc213e0c6e
9 changed files with 307 additions and 290 deletions
@@ -0,0 +1,16 @@
@php
$ticketTimeLogs = \Modules\Helpdesk\Models\TicketTimeLog::query()
->with('user')
->where('ticket_id', $ticket->getKey())
->whereNotNull('ended_at')
->latest('logged_at')
->get();
$ticketLoggedSeconds = (int) $ticketTimeLogs->sum(function ($timeLog) {
return (int) ($timeLog->seconds ?? ((int) $timeLog->minutes * 60));
});
$ticketLoggedHours = intdiv($ticketLoggedSeconds, 3600);
$ticketLoggedMinutes = intdiv($ticketLoggedSeconds % 3600, 60);
$ticketLoggedRemainingSeconds = $ticketLoggedSeconds % 60;
@endphp