0
我試圖使一個如下的sql的elqouent查詢,Laravel集團按日期
select sum(w.total_item_count) as Day_count, w.created_at as created_at from `sales_flat_orders` as `w` group by DATE(`w`.`created_at`) order by `w`.`created_at` asc
,我曾嘗試在SQL查詢這個
$orderbydate = DB::table('sales_flat_orders as w')
->select(array(DB::Raw('sum(w.total_item_count) as Day_count'),DB::Raw('DATE(w.created_at) as created_at')))
->groupBy('w.created_at')
->orderBy('w.created_at')
->get();
我得到正確的輸出,但不雄辯的查詢, 請幫忙,謝謝。