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) {