From 650c60b9f7a5d9359bbeeec17a8e099e0d8c18b1 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Wed, 15 May 2024 13:24:56 +0800 Subject: [PATCH] Update --- app/Services/StatisticService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/StatisticService.php b/app/Services/StatisticService.php index 8744bcc..e2885d2 100644 --- a/app/Services/StatisticService.php +++ b/app/Services/StatisticService.php @@ -197,7 +197,7 @@ class StatisticService ->groupBy('store_id'); $stores = Store::filter($input, StoreFilter::class) - ->selectRaw('stores.*,IFNULL(store_ledgers.sales, 0) as sales,IFNULL(store_ledgers.expenditure, 0) as expenditure') + ->selectRaw('stores.*,IFNULL(store_ledgers.sales, 0) as sales,IFNULL(store_ledgers.expenditure, 0) as expenditure,IFNULL(store_ledgers.new_customers, 0) as new_customers') ->leftJoinSub($storeLedgers, 'store_ledgers', fn ($join) => $join->on('stores.id', '=', 'store_ledgers.store_id')) ->when($input['sort'] ?? '', function ($query, $sort) { foreach (explode(',', $sort) as $sort) {