$orderRes = DB::table('merchant_order')->where(['state' => 1])
->first(array(
DB::raw('SUM(total_money) as total_money'),
DB::raw('SUM(my_final_money) as my_final_money'),
DB::raw('SUM(merchant_money) as merchant_money'),
DB::raw('SUM(subsidy_money) as subsidy_money'),
DB::raw('SUM(promoter_money) as promoter_money'),
DB::raw('SUM(signer_money) as signer_money'),
DB::raw('COUNT(id) as order_num'),
));
laravel:实现一次查询多个统计数据字段
最新推荐文章于 2024-08-22 10:10:35 发布