feat(chat): 增加五子棋的后台历史记录查阅面板与统计展示
This commit is contained in:
@@ -17,6 +17,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\BaccaratBet;
|
||||
use App\Models\BaccaratRound;
|
||||
use App\Models\FortuneLog;
|
||||
use App\Models\GomokuGame;
|
||||
use App\Models\HorseBet;
|
||||
use App\Models\HorseRace;
|
||||
use App\Models\LotteryIssue;
|
||||
@@ -83,6 +84,14 @@ class GameHistoryController extends Controller
|
||||
'today_issues' => LotteryIssue::query()->whereDate('created_at', today())->count(),
|
||||
];
|
||||
|
||||
// 五子棋
|
||||
$gomoku = [
|
||||
'total_games' => GomokuGame::query()->count(),
|
||||
'pvp_count' => GomokuGame::query()->where('is_pvp', true)->count(),
|
||||
'pve_count' => GomokuGame::query()->where('is_pvp', false)->count(),
|
||||
'today_games' => GomokuGame::query()->whereDate('created_at', today())->count(),
|
||||
];
|
||||
|
||||
return response()->json([
|
||||
'baccarat' => $baccarat,
|
||||
'slot' => $slot,
|
||||
@@ -90,6 +99,7 @@ class GameHistoryController extends Controller
|
||||
'mystery_box' => $mysteryBox,
|
||||
'fortune' => $fortune,
|
||||
'lottery' => $lottery,
|
||||
'gomoku' => $gomoku,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -281,4 +291,25 @@ class GameHistoryController extends Controller
|
||||
|
||||
return view('admin.game-history.lottery-issue', compact('issue', 'tickets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 五子棋历史记录页面。
|
||||
*/
|
||||
public function gomoku(Request $request): View
|
||||
{
|
||||
$summary = [
|
||||
'total_games' => GomokuGame::query()->count(),
|
||||
'pvp_count' => GomokuGame::query()->where('is_pvp', true)->count(),
|
||||
'pve_count' => GomokuGame::query()->where('is_pvp', false)->count(),
|
||||
'completed' => GomokuGame::query()->where('status', 'finished')->count(),
|
||||
'today_games' => GomokuGame::query()->whereDate('created_at', today())->count(),
|
||||
];
|
||||
|
||||
$games = GomokuGame::query()
|
||||
->with(['playerBlack', 'playerWhite'])
|
||||
->latest()
|
||||
->paginate(30);
|
||||
|
||||
return view('admin.game-history.gomoku', compact('games', 'summary'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user