Exemplo n.º 1
0
 protected function selectTikectsList()
 {
     return ticket::selectRaw('tickets.*, ' . '(SELECT COUNT(*) FROM ticket_comments WHERE ticket_comments.ticket_id = tickets.id) as num_comments,' . '(SELECT COUNT(*) FROM ticket_votes WHERE ticket_votes.ticket_id = tickets.id) as num_votes')->with('author');
 }