fix(chat): 修正五子棋查询状态字段为 mode

This commit is contained in:
2026-03-12 08:53:23 +08:00
parent 289b79affe
commit f614e07b8f

View File

@@ -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(),
];