1.优化开奖和推送
2.新增控制连续开奖赔率
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\library\game\StreakWinReward;
|
||||
use support\think\Db;
|
||||
|
||||
/**
|
||||
@@ -11,8 +12,6 @@ use support\think\Db;
|
||||
*/
|
||||
final class GameRecordStatService
|
||||
{
|
||||
private const BASE_ODDS = 33;
|
||||
|
||||
/**
|
||||
* 根据注单与开奖号码回写 game_record 统计字段(已结束对局)。
|
||||
*/
|
||||
@@ -82,7 +81,7 @@ final class GameRecordStatService
|
||||
}
|
||||
|
||||
/**
|
||||
* 与 GameLiveService::estimateLossForNumber 中派彩一致:命中号码时 total_amount × (streak+1) × 33。
|
||||
* 与 GameLiveService::estimateLossForNumber 一致:命中号码时 total_amount × odds_factor。
|
||||
*/
|
||||
private static function estimatePayoutForBet(array $bet, int $resultNumber): string
|
||||
{
|
||||
@@ -99,7 +98,7 @@ final class GameRecordStatService
|
||||
}
|
||||
$total = (string) ($bet['total_amount'] ?? '0');
|
||||
$streak = (int) ($bet['streak_at_bet'] ?? 0);
|
||||
$odds = (string) (($streak + 1) * self::BASE_ODDS);
|
||||
$odds = StreakWinReward::totalOddsMultiplierForStreakAtBet($streak);
|
||||
|
||||
return bcmul($total, $odds, 4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user