1.新增默认彩金池配置
2.优化关联彩金池配置的名称显示 3.优化一键测试权重 4.优化底注配置
This commit is contained in:
@@ -143,6 +143,8 @@ class PlayStartLogic
|
||||
&& $poolProfitTotal >= $safetyLine
|
||||
&& $configKill !== null;
|
||||
|
||||
$playerLinkedPool = $this->resolvePlayerLinkedPoolConfig($player, $configDeptId);
|
||||
|
||||
if ($ticketType === self::LOTTERY_TYPE_FREE) {
|
||||
// 免费抽奖券:使用本渠道 name=free 奖池档位权重;无 free 时回退 default
|
||||
$config = $configFree ?? $configType0;
|
||||
@@ -151,9 +153,13 @@ class PlayStartLogic
|
||||
$config = $configKill;
|
||||
$usePoolWeights = true;
|
||||
} else {
|
||||
// 付费未触发杀分:按玩家 T*_weight 抽档,lottery_config_id 记 default
|
||||
// 付费未触发杀分:关联 playerDefault 时实时读该池权重;否则按玩家行内 T*_weight
|
||||
$config = $configType0;
|
||||
$usePoolWeights = false;
|
||||
if ($playerLinkedPool !== null && $playerLinkedPool->isPlayerDefaultTemplate()) {
|
||||
$usePoolWeights = true;
|
||||
$config = $playerLinkedPool;
|
||||
}
|
||||
}
|
||||
|
||||
// 按档位 T1-T5 抽取后,从 DiceReward 表按当前方向取该档位数据,再按 weight 抽取一条得到 grid_number
|
||||
@@ -263,6 +269,9 @@ class PlayStartLogic
|
||||
$record = null;
|
||||
$settledWinCoin = $winCoin;
|
||||
$configId = (int) $config->id;
|
||||
if ($ticketType === self::LOTTERY_TYPE_PAID && !$usePaidKill && $playerLinkedPool !== null) {
|
||||
$configId = (int) $playerLinkedPool->id;
|
||||
}
|
||||
$type0ConfigId = (int) $configType0->id;
|
||||
$rewardId = ($isWin === 1 && $superWinCoin > 0) ? 0 : $targetIndex; // 中豹子不记录原奖励配置 id
|
||||
$configName = (string) ($config->name ?? '');
|
||||
@@ -789,4 +798,24 @@ class PlayStartLogic
|
||||
'grants_free_ticket' => $grantsFreeTicket,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家已选彩金池配置(用于 playerDefault 运行时权重)
|
||||
*/
|
||||
private function resolvePlayerLinkedPoolConfig(DicePlayer $player, int $configDeptId): ?DiceLotteryPoolConfig
|
||||
{
|
||||
$linkedId = (int) ($player->lottery_config_id ?? 0);
|
||||
if ($linkedId <= 0) {
|
||||
return null;
|
||||
}
|
||||
$cfg = DiceLotteryPoolConfig::find($linkedId);
|
||||
if (!$cfg) {
|
||||
return null;
|
||||
}
|
||||
$poolDeptId = AdminScopeHelper::normalizeRecordDeptId($cfg->dept_id ?? null);
|
||||
if ($poolDeptId !== AdminScopeHelper::normalizeRecordDeptId($configDeptId)) {
|
||||
return null;
|
||||
}
|
||||
return $cfg;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user