This commit is contained in:
iVampireSP.com 2022-10-21 12:33:54 +08:00
parent 76e5f30c0f
commit 23c13c7185
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -48,10 +48,11 @@ public function handle()
$users = User::count(); $users = User::count();
$transactions = new Transaction(); $transactions = new Transaction();
// 获取今年的交易记录 // 获取今年的交易记录 (MongoDB)
$transactions = $transactions->whereYear('created_at', date('Y')); $startOfYear = now()->startOfYear();
$endOfYear = now()->endOfYear();
$transactions = $transactions->count(); $transactions = Transaction::where('type', 'payout')->whereBetween('created_at', [$startOfYear, $endOfYear])->count();
$hosts = Host::count(); $hosts = Host::count();
$workOrders = WorkOrder::count(); $workOrders = WorkOrder::count();
@ -65,6 +66,6 @@ public function handle()
$this->warn('服务器数量: ' . $servers); $this->warn('服务器数量: ' . $servers);
$this->warn('工单数量: ' . $workOrders); $this->warn('工单数量: ' . $workOrders);
$this->warn('工单回复数量: ' . $replies); $this->warn('工单回复数量: ' . $replies);
$this->warn('今年的交易记录: ' . $transactions); $this->warn('今年的交易记录: ' . $transactions . ' 条');
} }
} }