1.新增获取充值/提现配置接口/api/finance/depositWithdrawConfig
2.优化充值和提现方式
This commit is contained in:
@@ -207,12 +207,12 @@ final class GameLiveService
|
||||
for ($n = 1; $n <= self::DRAW_NUMBER_MAX; $n++) {
|
||||
$loss = self::estimateLossForNumber($bets, $n);
|
||||
$candidates[] = ['number' => $n, 'estimated_loss' => $loss];
|
||||
if ($bestLoss === null || bccomp((string) $loss, (string) $bestLoss, 4) < 0) {
|
||||
if ($bestLoss === null || bccomp((string) $loss, (string) $bestLoss, 2) < 0) {
|
||||
$bestLoss = $loss;
|
||||
$bestNumbers = [$n];
|
||||
continue;
|
||||
}
|
||||
if (bccomp((string) $loss, (string) $bestLoss, 4) === 0) {
|
||||
if (bccomp((string) $loss, (string) $bestLoss, 2) === 0) {
|
||||
$bestNumbers[] = $n;
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ final class GameLiveService
|
||||
}
|
||||
|
||||
$finalNumber = $manualNumber ?? $bestNumber;
|
||||
$finalLoss = '0.0000';
|
||||
$finalLoss = '0.00';
|
||||
if ($finalNumber !== null) {
|
||||
$finalLoss = self::estimateLossForNumber($bets, $finalNumber);
|
||||
}
|
||||
@@ -558,7 +558,7 @@ final class GameLiveService
|
||||
if ($betId <= 0) {
|
||||
continue;
|
||||
}
|
||||
if ($userId <= 0 || bccomp($total, '0', 4) <= 0) {
|
||||
if ($userId <= 0 || bccomp($total, '0', 2) <= 0) {
|
||||
Db::name('bet_order')->where('id', $betId)->where('status', 1)->update([
|
||||
'status' => 3,
|
||||
'update_time' => $now,
|
||||
@@ -566,7 +566,7 @@ final class GameLiveService
|
||||
continue;
|
||||
}
|
||||
$before = (string) (Db::name('user')->where('id', $userId)->value('coin') ?? '0');
|
||||
$after = bcadd($before, $total, 4);
|
||||
$after = bcadd($before, $total, 2);
|
||||
$u = Db::name('user')->where('id', $userId)->where('coin', $before)->update([
|
||||
'coin' => $after,
|
||||
'update_time' => $now,
|
||||
@@ -836,12 +836,12 @@ final class GameLiveService
|
||||
$bestNumbers = [];
|
||||
for ($n = 1; $n <= self::DRAW_NUMBER_MAX; $n++) {
|
||||
$loss = self::estimateLossForNumber($bets, $n);
|
||||
if ($bestLoss === null || bccomp((string) $loss, (string) $bestLoss, 4) < 0) {
|
||||
if ($bestLoss === null || bccomp((string) $loss, (string) $bestLoss, 2) < 0) {
|
||||
$bestLoss = $loss;
|
||||
$bestNumbers = [$n];
|
||||
continue;
|
||||
}
|
||||
if (bccomp((string) $loss, (string) $bestLoss, 4) === 0) {
|
||||
if (bccomp((string) $loss, (string) $bestLoss, 2) === 0) {
|
||||
$bestNumbers[] = $n;
|
||||
}
|
||||
}
|
||||
@@ -878,7 +878,7 @@ final class GameLiveService
|
||||
|
||||
private static function estimateLossForNumber(array $bets, int $number): string
|
||||
{
|
||||
$payout = '0.0000';
|
||||
$payout = '0.00';
|
||||
foreach ($bets as $bet) {
|
||||
$pickNumbers = $bet['pick_numbers'];
|
||||
if (is_string($pickNumbers)) {
|
||||
@@ -894,8 +894,8 @@ final class GameLiveService
|
||||
$total = (string) ($bet['total_amount'] ?? '0');
|
||||
$streak = (int) ($bet['streak_at_bet'] ?? 0);
|
||||
$odds = StreakWinReward::totalOddsMultiplierForStreakAtBet($streak);
|
||||
$orderPayout = bcmul($total, $odds, 4);
|
||||
$payout = bcadd($payout, $orderPayout, 4);
|
||||
$orderPayout = bcmul($total, $odds, 2);
|
||||
$payout = bcadd($payout, $orderPayout, 2);
|
||||
}
|
||||
return $payout;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user