mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 21:28:27 +08:00
update: fix order statistics
This commit is contained in:
@ -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');
|
||||
|
@ -239,6 +239,7 @@ class OrderService
|
||||
return true;
|
||||
}
|
||||
$order->status = 1;
|
||||
$order->paid_at = time();
|
||||
$order->callback_no = $callbackNo;
|
||||
return $order->save();
|
||||
}
|
||||
|
Reference in New Issue
Block a user