统计优化

pull/1/head
jcadmin 2025-10-08 20:52:21 +08:00
parent fc9a52c9ee
commit d9eb6a72e0
1 changed files with 2 additions and 1 deletions

View File

@ -253,10 +253,11 @@ class ReportController extends BaseController
} }
$query = Order::select([ $query = Order::select([
DB::raw('sum(money) as money'), DB::raw('sum(IF(type = 3, union_money, money)) as money'),
DB::raw('count(*) as count'), DB::raw('count(*) as count'),
'lottery_type_id', 'lottery_type_id',
]) ])
->usable()
->where('draft_shop_id', $this->shopId()); ->where('draft_shop_id', $this->shopId());
if ($dateStart) { if ($dateStart) {