feat: 重构代码架构 + 新增报表/跟单/输赢统计功能

- 拆分 HomeController → TransactionController, ReportWebController, FollowPlanController
- 新增 Service 层: TransactionService, ReportService, FollowPlanService
- pk10.php JS 抽离为 4 个独立文件 (sound/race/bet/poll)
- 前台新增报表查询页面 (/report) + 跟单计划页面 (/follow-plan)
- 后台新增跟单计划管理 + 用户输赢明细统计
- 封盘状态显示倒计时 (x:xx)
- 音效仅在开奖弹窗打开时播放
- 路由按模块分组整理
- autoload 支持 App\Services 命名空间
This commit is contained in:
li
2026-03-27 18:41:06 +08:00
parent 48cfe4be04
commit 4a94fe36cf
87 changed files with 8681 additions and 646 deletions
+37 -1
View File
@@ -36,6 +36,13 @@
<a href="/admin/dashboard" class="flex items-center text-primary font-bold text-xl">
<?php
$adminSettings = \App\Core\SettingsHelper::getAll();
// 查询充提待处理数量(侧边栏角标用)
try {
$_fundDb = new \Db\Database();
$pendingFundCount = $_fundDb->count('fund_requests', ['status' => 'pending']);
} catch (\Throwable $e) {
$pendingFundCount = 0;
}
?>
<img src="<?= htmlspecialchars($adminSettings['site_logo'] ?? '/Static/tm68/logo_tm68.png.png') ?>" class="w-10 mr-2">
<span>管理后台</span>
@@ -116,6 +123,11 @@
<i class="fas fa-list-alt w-5 text-center"></i>
<span>投注记录</span>
</a>
<a href="/admin/fund-requests" class="flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 hover:bg-gray-light main-menu-item relative">
<i class="fas fa-file-invoice-dollar w-5 text-center"></i>
<span>充提审核</span>
<span id="fundRequestBadge" class="absolute right-2 top-1/2 -translate-y-1/2 bg-danger text-white text-xs rounded-full min-w-[20px] h-5 flex items-center justify-center px-1" style="<?= ((int)($pendingFundCount ?? 0)) > 0 ? '' : 'display:none' ?>"><?= (int)($pendingFundCount ?? 0) ?></span>
</a>
<a href="/admin/finance" class="flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 hover:bg-gray-light main-menu-item">
<i class="fas fa-dollar-sign w-5 text-center"></i>
<span>财务管理</span>
@@ -136,6 +148,14 @@
<i class="fas fa-chart-bar w-5 text-center"></i>
<span>数据报表</span>
</a>
<a href="/admin/follow-plans" class="flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 hover:bg-gray-light main-menu-item">
<i class="fas fa-clipboard-list w-5 text-center"></i>
<span>跟单计划</span>
</a>
<a href="/admin/bots" class="flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 hover:bg-gray-light main-menu-item">
<i class="fas fa-robot w-5 text-center"></i>
<span>Bot 管理</span>
</a>
<a href="/admin/settings" class="flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 hover:bg-gray-light main-menu-item">
<i class="fas fa-cog w-5 text-center"></i>
<span>系统设置</span>
@@ -265,7 +285,7 @@
<footer class="bg-white border-t border-gray-200 py-4 md:ml-64 transition-all duration-300">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex flex-col md:flex-row justify-between items-center">
<p class="text-sm text-gray-500"> &copy; <?=date('Y')?> PK10 极速赛车后台管理系统 </p>
<p class="text-sm text-gray-500"> &copy; <?=date('Y')?> F1赛车后台管理系统 </p>
</div>
</div>
</footer>
@@ -274,6 +294,22 @@
<script> const targetUsername = '<?= htmlspecialchars($_SESSION[' username '] ?? ' ') ?>'; </script>
<script src="/Static/js/controller.js"> </script>
<script src="/Static/js/admin.js"> </script>
<script>
// 全局轮询充提待处理角标
(function(){
var badge = document.getElementById('fundRequestBadge');
if(!badge) return;
setInterval(function(){
fetch('/admin/fund-requests/pending-count')
.then(function(r){return r.json();})
.then(function(d){
var c = d.count || 0;
badge.textContent = c;
badge.style.display = c > 0 ? '' : 'none';
}).catch(function(){});
}, 15000);
})();
</script>
</body>
</html>