1.新增获取充值/提现配置接口/api/finance/depositWithdrawConfig

2.优化充值和提现方式
This commit is contained in:
2026-04-23 10:15:01 +08:00
parent 0f28c0fd2a
commit aa1299c018
55 changed files with 901 additions and 750 deletions

View File

@@ -59,8 +59,8 @@ class Game extends MobileBase
],
'bet_config' => [
'pick_max_number_count' => $this->getPickMaxNumberCount(),
'chips' => ['1.0000', '5.0000', '10.0000', '25.0000', '50.0000', '100.0000'],
'single_number_max_bet' => $this->getConfigValue('single_number_max_bet', '500.0000'),
'chips' => ['1.00', '5.00', '10.00', '25.00', '50.00', '100.00'],
'single_number_max_bet' => $this->getConfigValue('single_number_max_bet', '500.00'),
],
'dictionary' => $items,
'user_snapshot' => [
@@ -157,10 +157,10 @@ class Game extends MobileBase
if ($periodNo === '' || $betAmount === '' || $idempotencyKey === '') {
return $this->mobileError(1001, 'Missing parameters');
}
if (!is_numeric($betAmount) || bccomp($betAmount, '0', 4) <= 0) {
if (!is_numeric($betAmount) || bccomp($betAmount, '0', 2) <= 0) {
return $this->mobileError(1003, 'Invalid parameter value');
}
$totalAmount = bcadd($betAmount, '0', 4);
$totalAmount = bcadd($betAmount, '0', 2);
$numbers = $this->parseBetNumbersFromRequest($numbersRaw);
if ($numbers === []) {
@@ -189,7 +189,7 @@ class Game extends MobileBase
}
$user = $this->auth->getUser();
if (bccomp((string) $user->coin, $totalAmount, 4) < 0) {
if (bccomp((string) $user->coin, $totalAmount, 2) < 0) {
return $this->mobileError(2001, 'Insufficient balance');
}
@@ -209,7 +209,7 @@ class Game extends MobileBase
return $this->mobileError(5000, 'System is busy, please try again later');
}
$before = (string) ($coinRow['coin'] ?? '0');
if (bccomp($before, $totalAmount, 4) < 0) {
if (bccomp($before, $totalAmount, 2) < 0) {
return $this->mobileError(2001, 'Insufficient balance');
}
@@ -225,7 +225,7 @@ class Game extends MobileBase
}
$now = time();
$after = bcsub($before, $totalAmount, 4);
$after = bcsub($before, $totalAmount, 2);
$orderNo = 'BO' . date('YmdHis') . substr(str_replace('.', '', uniqid('', true)), -6);
$streakAtBet = (int) ($coinRow['current_streak'] ?? 0);
@@ -286,7 +286,7 @@ class Game extends MobileBase
'order_no' => $orderNo,
'period_no' => $period->period_no,
'status' => 'accepted',
'locked_balance' => '0.0000',
'locked_balance' => '0.00',
'balance_after' => $after,
'current_streak' => $streakAtBet,
]);