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
+19
View File
@@ -2,6 +2,19 @@
<h2 class="text-2xl font-bold mb-2">🌊 放水控制 & 投注限额</h2>
<p class="text-gray-500 text-sm mb-6">放水 = 控制玩家胜率。百分比越低,平台赢得越多。设为50%表示公平对赌。</p>
<!-- 平台盈利率目标 -->
<div class="bg-white rounded-xl p-4 shadow mb-6">
<h3 class="font-bold mb-2">🎯 平台盈利率目标</h3>
<div style="display:flex;align-items:center;gap:15px;flex-wrap:wrap">
<span>目标盈利率:</span>
<input type="number" id="targetProfitRate" value="<?=htmlspecialchars($targetProfitRate ?? '15')?>"
min="0" max="100" step="1" class="w-24 border rounded px-2 py-1 text-sm text-center">
<span>%</span>
<button onclick="saveProfitRate()" class="px-4 py-1 bg-purple-500 text-white rounded hover:bg-purple-600 text-sm">保存</button>
<span style="color:#999;font-size:12px">说明:0=取最大利润(原逻辑),15=平台每期目标盈利15%</span>
</div>
</div>
<?php
// 投注类型中文映射
$betTypeLabels = [
@@ -87,6 +100,12 @@ function getBetLabel($type, $labels) {
</div>
<script>
async function saveProfitRate(){
const rate=parseFloat(document.getElementById('targetProfitRate').value);
if(isNaN(rate)||rate<0||rate>100){alert('请输入0-100之间的数值');return;}
const r=await fetch('/admin/water/profit-rate',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({target_profit_rate:rate})});
const d=await r.json();alert(d.status==='success'?'盈利率目标保存成功!':d.message);
}
async function saveWater(){
const items=[];
document.querySelectorAll('.water-pct').forEach(el=>{