1.优化抽奖券的抽奖逻辑
This commit is contained in:
@@ -96,7 +96,7 @@ class DiceRewardController extends BaseController
|
||||
* 参数:lottery_config_id 可选;paid_tier_weights / free_tier_weights 自定义档位;
|
||||
* paid_s_count, paid_n_count
|
||||
* chain_free_mode=1:仅按付费次数模拟;付费抽到再来一次/T5 则在队列中插入免费局(同底注、lottery_type=免费、paid_amount=0)
|
||||
* kill_mode_enabled=1:测试内启用杀分;规则与线上一致(default.profit_amount + safety_line + kill_enabled)
|
||||
* kill_mode_enabled=1:测试内启用杀分;当模拟池盈利达到 test_safety_line 后,付费抽奖切到 killScore
|
||||
*/
|
||||
#[Permission('一键测试权重', 'dice:reward:index:startWeightTest')]
|
||||
public function startWeightTest(Request $request): Response
|
||||
|
||||
@@ -17,7 +17,7 @@ use support\think\Db;
|
||||
* 一键测试权重:单进程后台执行模拟摇色子,写入 dice_play_record_test 并更新 dice_reward_config_record 进度
|
||||
* 抽奖规则与 PlayStartLogic 一致:
|
||||
* - 付费未杀分:按模拟玩家档位权重抽档,lottery_config_id 记 default
|
||||
* - 付费杀分:default.profit_amount + safety_line + kill_enabled 满足后切 killScore
|
||||
* - 付费杀分:测试内杀分开启且模拟池盈利 >= test_safety_line 后切 killScore
|
||||
* - 免费券:name=free 奖池(无则 default),排除 5/30 豹子
|
||||
*/
|
||||
class WeightTestRunner
|
||||
@@ -115,10 +115,12 @@ class WeightTestRunner
|
||||
DiceReward::clearRequestInstance();
|
||||
|
||||
$killModeEnabled = (int) ($record->kill_mode_enabled ?? 0) === 1;
|
||||
$safetyLine = (int) ($configType0->safety_line ?? 0);
|
||||
$dbKillEnabled = ((int) ($configType0->kill_enabled ?? 1)) === 1;
|
||||
$testSafetyLine = (int) ($record->test_safety_line ?? 5000);
|
||||
if ($testSafetyLine < 0) {
|
||||
$testSafetyLine = 0;
|
||||
}
|
||||
|
||||
// 彩金池累计盈利:与线上一致,从 default.profit_amount 起步并在测试内逐局累加
|
||||
// 彩金池累计盈利:从 default.profit_amount 起步并在测试内逐局累加,与杀分判定值一致
|
||||
$poolProfitTotal = (float) ($configType0->profit_amount ?? 0);
|
||||
|
||||
// 付费未杀分时的模拟玩家档位权重(自定义 > 快照 > 兜底奖池)
|
||||
@@ -145,8 +147,7 @@ class WeightTestRunner
|
||||
$paidPlayerWeights,
|
||||
$freeTierWeightsCustom,
|
||||
$killModeEnabled,
|
||||
$safetyLine,
|
||||
$dbKillEnabled,
|
||||
$testSafetyLine,
|
||||
$poolProfitTotal,
|
||||
$resultCounts,
|
||||
$tierCounts,
|
||||
@@ -186,8 +187,7 @@ class WeightTestRunner
|
||||
?array $paidPlayerWeights,
|
||||
?array $freeTierWeightsCustom,
|
||||
bool $killModeEnabled,
|
||||
int $safetyLine,
|
||||
bool $dbKillEnabled,
|
||||
int $testSafetyLine,
|
||||
float &$poolProfitTotal,
|
||||
array &$resultCounts,
|
||||
array &$tierCounts,
|
||||
@@ -211,8 +211,7 @@ class WeightTestRunner
|
||||
|
||||
if ($isPaid) {
|
||||
$useKillForPaid = $killModeEnabled
|
||||
&& $dbKillEnabled
|
||||
&& $poolProfitTotal >= $safetyLine
|
||||
&& $poolProfitTotal >= $testSafetyLine
|
||||
&& $killPoolConfig !== null;
|
||||
if ($useKillForPaid) {
|
||||
$cfg = $killPoolConfig;
|
||||
|
||||
Reference in New Issue
Block a user