$departments = Order::join('categories', 'orders.category_id', '=', 'categories.id') ->join('departments', 'categories.department_id', '=', 'departments.id') ->select('departments.name') ->where(function($query) use ($date_from, $date_to) { $query->whereBetween('created_at', [ $date_from." 00:00:00" , $date_to." 23:59:59" ]); }) ->groupBy('categories.department_id') ->selectRaw('count(*) as total') ->get();
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HuuRkP
via IFTTT
Aucun commentaire:
Enregistrer un commentaire