Пример #1
0
 protected function selectTicketList()
 {
     return Ticket::selectRaw('tickets.*, ' . '(select count(*) from ticket_comments where ticket_comments.ticket_id = tickets.id) as num_commnents,' . '(select count(*) from ticket_votes where ticket_votes.ticket_id = tickets.id) as num_votes')->with('author');
 }