generated from liutk/owl-admin-base
Update
parent
61f229cb70
commit
c4dbeaaf22
|
|
@ -118,6 +118,10 @@ class StatisticService
|
|||
*/
|
||||
public function sales(Carbon $start, Carbon $end, array $input = []): array
|
||||
{
|
||||
$input = array_merge($input, [
|
||||
'date_range' => $start->toDateString().','.$end->toDateString(),
|
||||
]);
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Collection */
|
||||
$lotteryTypes = Keyword::where('parent_key', 'lottery_type')->get();
|
||||
|
||||
|
|
@ -129,7 +133,6 @@ class StatisticService
|
|||
DB::raw('SUM(expenditure) as expenditure')
|
||||
])
|
||||
->filter($input, LedgerFilter::class)
|
||||
->whereBetween('date', [$start->format('Y-m-d'), $end->format('Y-m-d')])
|
||||
->groupBy(['date'])
|
||||
->get()
|
||||
->keyBy('date');
|
||||
|
|
@ -143,7 +146,6 @@ class StatisticService
|
|||
])
|
||||
->filter($input, LedgerItemFilter::class)
|
||||
->whereIn('ledger_item_type_id', $lotteryTypes->pluck('key'))
|
||||
->whereBetween('date', [$start->format('Y-m-d'), $end->format('Y-m-d')])
|
||||
->groupBy(['date', 'ledger_item_type_id'])
|
||||
->get()
|
||||
->groupBy('date');
|
||||
|
|
|
|||
Loading…
Reference in New Issue