- 拆分 HomeController → TransactionController, ReportWebController, FollowPlanController - 新增 Service 层: TransactionService, ReportService, FollowPlanService - pk10.php JS 抽离为 4 个独立文件 (sound/race/bet/poll) - 前台新增报表查询页面 (/report) + 跟单计划页面 (/follow-plan) - 后台新增跟单计划管理 + 用户输赢明细统计 - 封盘状态显示倒计时 (x:xx) - 音效仅在开奖弹窗打开时播放 - 路由按模块分组整理 - autoload 支持 App\Services 命名空间
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
namespace App\Controllers\Web;
|
|
|
|
use App\Core\WebBaseController;
|
|
use App\Services\TransactionService;
|
|
use Db\Database;
|
|
|
|
class TransactionController extends WebBaseController {
|
|
|
|
public function fundRequest() {
|
|
$this->checkWebLogin();
|
|
header('Content-Type: application/json');
|
|
$data = json_decode(file_get_contents('php://input'), true);
|
|
$service = new TransactionService(new Database());
|
|
$result = $service->fundRequest(
|
|
$this->getCurrentUserId(),
|
|
$data['type'] ?? '',
|
|
floatval($data['amount'] ?? 0),
|
|
$data['remark'] ?? ''
|
|
);
|
|
echo json_encode($result);
|
|
}
|
|
|
|
public function transfer() {
|
|
$this->checkWebLogin();
|
|
header('Content-Type: application/json');
|
|
$data = json_decode(file_get_contents('php://input'), true);
|
|
$service = new TransactionService(new Database());
|
|
$result = $service->transfer(
|
|
$this->getCurrentUserId(),
|
|
trim($data['to_username'] ?? ''),
|
|
floatval($data['amount'] ?? 0)
|
|
);
|
|
echo json_encode($result);
|
|
}
|
|
}
|