fixed ticket display
This commit is contained in:
@@ -316,21 +316,15 @@ final class TicketShow extends Component
|
||||
]) ?? $ticket;
|
||||
|
||||
$this->hydrateTicketUsers($ticket);
|
||||
|
||||
$comments = Comment::query()
|
||||
->where('ticket_id', $ticket->id)
|
||||
->when(Schema::hasColumn('helpdesk_comments', 'deleted_at'), static function ($query): void {
|
||||
$query->whereNull('deleted_at');
|
||||
})
|
||||
->when(Schema::hasColumn('helpdesk_comments', 'tombstoned_at'), static function ($query): void {
|
||||
$query->whereNull('tombstoned_at');
|
||||
})
|
||||
$comments = $ticket->comments()
|
||||
->active()
|
||||
->when(! $this->canSeeInternalNotes(), static function ($query): void {
|
||||
$query->where('is_internal', false);
|
||||
})
|
||||
->with(['user.company', 'attachments'])
|
||||
->with(['user.company', 'attachments', 'replies.user.company', 'replies.attachments'])
|
||||
->oldest()
|
||||
->get();
|
||||
$ticket->setRelation('comments', $comments);
|
||||
|
||||
$ticket->setAttribute('public_replies_count', $comments->where('is_internal', false)->count());
|
||||
$ticket->setAttribute('time_spent_minutes', $this->sumCommentMinutes($comments));
|
||||
|
||||
Reference in New Issue
Block a user