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:
@@ -13,7 +13,8 @@ class WaterController extends AdminBaseController {
|
||||
$gameId = $this->getGameId();
|
||||
$configs = $this->db->select('water_control', '*', ['game_id' => $gameId]);
|
||||
$limits = $this->db->select('bet_limits', '*', ['game_id' => $gameId]);
|
||||
$this->render('Admin/water_control.php', compact('configs', 'limits', 'gameId'));
|
||||
$targetProfitRate = \App\Core\SettingsHelper::get('target_profit_rate');
|
||||
$this->render('Admin/water_control.php', compact('configs', 'limits', 'gameId', 'targetProfitRate'));
|
||||
}
|
||||
|
||||
public function updateWater() {
|
||||
@@ -61,6 +62,26 @@ class WaterController extends AdminBaseController {
|
||||
$this->json(['status' => 'success']);
|
||||
}
|
||||
|
||||
public function updateProfitRate() {
|
||||
$this->checkLogin(); $this->checkAdmin();
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
$rate = isset($data['target_profit_rate']) ? floatval($data['target_profit_rate']) : 15;
|
||||
if ($rate < 0 || $rate > 100) {
|
||||
$this->json(['status' => 'error', 'message' => '盈利率必须在0-100之间']);
|
||||
return;
|
||||
}
|
||||
|
||||
$db = $this->db;
|
||||
$existing = $db->get('system_settings', 'id', ['setting_key' => 'target_profit_rate']);
|
||||
if ($existing) {
|
||||
$db->update('system_settings', ['setting_value' => (string)$rate], ['id' => $existing]);
|
||||
} else {
|
||||
$db->insert('system_settings', ['setting_key' => 'target_profit_rate', 'setting_value' => (string)$rate]);
|
||||
}
|
||||
\App\Core\SettingsHelper::clearCache();
|
||||
$this->json(['status' => 'success']);
|
||||
}
|
||||
|
||||
private function getGameId(): int {
|
||||
if (!empty($_GET['game_id'])) return (int)$_GET['game_id'];
|
||||
return (int)($this->db->get('games', 'id', ['code' => 'pk10']) ?: 0);
|
||||
|
||||
Reference in New Issue
Block a user