update: fix order statistics

This commit is contained in:
tokumeikoi
2021-07-31 02:21:49 +09:00
parent ebf98d42a8
commit 06adaa2124
4 changed files with 8 additions and 3 deletions

View File

@ -50,8 +50,8 @@ class V2boardStatistics extends Command
{
$endAt = strtotime(date('Y-m-d'));
$startAt = strtotime('-1 day', $endAt);
$builder = Order::where('created_at', '>=', $startAt)
->where('created_at', '<', $endAt)
$builder = Order::where('paid_at', '>=', $startAt)
->where('paid_at', '<', $endAt)
->whereNotIn('status', [0, 2]);
$orderCount = $builder->count();
$orderAmount = $builder->sum('total_amount');