diff --git a/app/Http/Controllers/Admin/GameHistoryController.php b/app/Http/Controllers/Admin/GameHistoryController.php index a95502a..2ebc7c9 100644 --- a/app/Http/Controllers/Admin/GameHistoryController.php +++ b/app/Http/Controllers/Admin/GameHistoryController.php @@ -87,8 +87,8 @@ class GameHistoryController extends Controller // 五子棋 $gomoku = [ 'total_games' => GomokuGame::query()->count(), - 'pvp_count' => GomokuGame::query()->where('is_pvp', true)->count(), - 'pve_count' => GomokuGame::query()->where('is_pvp', false)->count(), + 'pvp_count' => GomokuGame::query()->where('mode', 'pvp')->count(), + 'pve_count' => GomokuGame::query()->where('mode', 'pve')->count(), 'today_games' => GomokuGame::query()->whereDate('created_at', today())->count(), ]; @@ -299,8 +299,8 @@ class GameHistoryController extends Controller { $summary = [ 'total_games' => GomokuGame::query()->count(), - 'pvp_count' => GomokuGame::query()->where('is_pvp', true)->count(), - 'pve_count' => GomokuGame::query()->where('is_pvp', false)->count(), + 'pvp_count' => GomokuGame::query()->where('mode', 'pvp')->count(), + 'pve_count' => GomokuGame::query()->where('mode', 'pve')->count(), 'completed' => GomokuGame::query()->where('status', 'finished')->count(), 'today_games' => GomokuGame::query()->whereDate('created_at', today())->count(), ];