Пример #1
0
 private function getCommentsData($id)
 {
     $ticket = new Ticket();
     $attachmentsArr = [];
     $attachments = $ticket->getCommentsAttachment($id);
     foreach ($attachments as $attachment) {
         $attachmentsArr[$attachment->comment_id][] = $attachment;
     }
     return ['comments' => $ticket->getTicketComments($id), 'attachments' => $attachmentsArr];
 }
Пример #2
0
 public function getTicketComments($id)
 {
     $ticket = new Ticket();
     $result = $ticket->getTicketComments($id);
     return response(['data' => $result], 200);
 }