$data = Table::select([
DB::raw('count(id) as orders'),
DB::raw('month(created_at) as month'),
])
->groupBy('month')
->get()
->toArray()
使用Laravel统计每月订单
最新推荐文章于 2024-05-30 17:08:10 发布
$data = Table::select([
DB::raw('count(id) as orders'),
DB::raw('month(created_at) as month'),
])
->groupBy('month')
->get()
->toArray()