1.优化常规配置/admin/config/gameConfig新增派彩时间设置
2.修复后台翻译问题
This commit is contained in:
@@ -25,13 +25,14 @@ final class GameLiveService
|
||||
private const EVT_PERIOD_PAYOUT = 'period.payout';
|
||||
private const KEY_PERIOD_SECONDS = 'period_seconds';
|
||||
private const KEY_BET_SECONDS = 'bet_seconds';
|
||||
private const KEY_PAYOUT_SECONDS = 'payout_seconds';
|
||||
private const KEY_PICK_MAX_NUMBER_COUNT = 'pick_max_number_count';
|
||||
|
||||
/** 开奖结果号码池:1 至此上限(与单注可选号码个数配置无关) */
|
||||
private const DRAW_NUMBER_MAX = 36;
|
||||
|
||||
/** 开奖后派彩展示宽限期(秒),之后再创建下一期 */
|
||||
private const PAYOUT_GRACE_SECONDS = 3;
|
||||
/** 派彩展示宽限期默认值(秒),可被 game_config.payout_seconds 覆盖 */
|
||||
private const DEFAULT_PAYOUT_SECONDS = 3;
|
||||
/** 启动自愈:判定“异常卡局”的最小超时冗余秒数 */
|
||||
private const STARTUP_RECOVER_GRACE_SECONDS = 10;
|
||||
|
||||
@@ -64,7 +65,7 @@ final class GameLiveService
|
||||
return;
|
||||
}
|
||||
$periodSeconds = self::getConfigInt(self::KEY_PERIOD_SECONDS, 30);
|
||||
$timeoutAt = $periodStartAt + $periodSeconds + self::PAYOUT_GRACE_SECONDS + self::STARTUP_RECOVER_GRACE_SECONDS;
|
||||
$timeoutAt = $periodStartAt + $periodSeconds + self::getPayoutGraceSeconds() + self::STARTUP_RECOVER_GRACE_SECONDS;
|
||||
if (time() <= $timeoutAt) {
|
||||
return;
|
||||
}
|
||||
@@ -98,7 +99,7 @@ final class GameLiveService
|
||||
GameBetSettleService::settleBetsForDraw($recordId, $resultNumber);
|
||||
if ($status === 2) {
|
||||
if ($payoutUntil <= 0) {
|
||||
$payoutUntil = $now + self::PAYOUT_GRACE_SECONDS;
|
||||
$payoutUntil = $now + self::getPayoutGraceSeconds();
|
||||
}
|
||||
Db::name('game_record')->where('id', $recordId)->update([
|
||||
'status' => 3,
|
||||
@@ -575,7 +576,7 @@ final class GameLiveService
|
||||
$bets = Db::name('bet_order')->where('period_id', (int) $record['id'])->select()->toArray();
|
||||
$finalLoss = self::estimateLossForNumber($bets, $finalNumber);
|
||||
$now = time();
|
||||
$payoutUntil = $now + self::PAYOUT_GRACE_SECONDS;
|
||||
$payoutUntil = $now + self::getPayoutGraceSeconds();
|
||||
|
||||
$settleOut = ['jackpot_hits' => []];
|
||||
Db::startTrans();
|
||||
@@ -1099,6 +1100,18 @@ final class GameLiveService
|
||||
return (int) $v;
|
||||
}
|
||||
|
||||
private static function getPayoutGraceSeconds(): int
|
||||
{
|
||||
$seconds = self::getConfigInt(self::KEY_PAYOUT_SECONDS, self::DEFAULT_PAYOUT_SECONDS);
|
||||
if ($seconds < 1) {
|
||||
return 1;
|
||||
}
|
||||
if ($seconds > 300) {
|
||||
return 300;
|
||||
}
|
||||
return $seconds;
|
||||
}
|
||||
|
||||
private static function getPickMaxNumberCount(): int
|
||||
{
|
||||
$max = self::getConfigInt(self::KEY_PICK_MAX_NUMBER_COUNT, 36);
|
||||
|
||||
Reference in New Issue
Block a user