优化平台币显示样式不显示小数点,优化中大奖计算

This commit is contained in:
2026-03-26 13:58:45 +08:00
parent d793a511ee
commit 748ee12a52
10 changed files with 95 additions and 26 deletions

View File

@@ -162,8 +162,8 @@ class PlayStartLogic
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
$realEv = (float) ($chosen['real_ev'] ?? 0);
$isTierT5 = (string) ($chosen['tier'] ?? '') === 'T5';
// 玩家始终增加:(100 + real_ev) * ante费用已在开始前扣除免费抽奖同样按该口径结算
$rewardWinCoin = (self::UNIT_COST + $realEv) * $ante;
// 摇色子中奖:按 dice_reward_config.real_ev 直接结算(已乘 ante不再叠加票价 100
$rewardWinCoin = $realEv * $ante;
// 豹子判定5/30 必豹子10/15/20/25 按 DiceRewardConfig 中 BIGWIN 该点数的 weight 判定0-1000010000=100%
// 杀分档位不触发豹子5/30 已在上方抽取时排除10/15/20/25 仅生成非豹子组合
@@ -197,7 +197,7 @@ class PlayStartLogic
$rollArray = $this->getSuperWinRollArray($rollNumber);
$isWin = 1;
$bigWinEv = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
$superWinCoin = (self::UNIT_COST + $bigWinEv) * $ante;
$superWinCoin = $bigWinEv * $ante;
// 中 BIGWIN 豹子:不走原奖励流程,不记录原奖励,不触发 T5 再来一次,仅发放豹子奖金
$rewardWinCoin = 0;
$realEv = 0;
@@ -322,8 +322,8 @@ class PlayStartLogic
$p->save();
// 彩金池累计盈利累加在 name=default 彩金池上:
// 付费:每局按“当前中奖金额(含 BIGWIN - 抽奖费用ante*100
// 免费券:取消票价成本 100只计入中奖金额
// 付费:每局按「本局赢取平台币 win_coin - 抽奖费用 paid_amountante*100
// 免费券:paid_amount=0只计入 win_coin
$perPlayProfit = ($ticketType === self::LOTTERY_TYPE_PAID) ? ($winCoin - (float) $paidAmount) : $winCoin;
$addProfit = $perPlayProfit;
try {
@@ -574,8 +574,8 @@ class PlayStartLogic
$targetIndex = (int) ($chosen['end_index'] ?? 0);
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
$realEv = (float) ($chosen['real_ev'] ?? 0);
// 玩家始终增加:(100 + real_ev) * ante
$rewardWinCoin = (self::UNIT_COST + $realEv) * $ante;
// 摇色子中奖:按 real_ev 直接结算(与正式抽奖 run() 一致)
$rewardWinCoin = $realEv * $ante;
$superWinCoin = 0;
$isWin = 0;
@@ -605,7 +605,7 @@ class PlayStartLogic
$rollArray = $this->getSuperWinRollArray($rollNumber);
$isWin = 1;
$bigWinEv = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
$superWinCoin = (self::UNIT_COST + $bigWinEv) * $ante;
$superWinCoin = $bigWinEv * $ante;
$rewardWinCoin = 0;
// 中豹子时不走原奖励流程
$realEv = 0.0;

View File

@@ -38,6 +38,7 @@ class DicePlayRecordTestController extends BaseController
public function index(Request $request): Response
{
$where = $request->more([
['reward_config_record_id', ''],
['lottery_type', ''],
['direction', ''],
['is_win', ''],

View File

@@ -22,6 +22,8 @@ class DicePlayRecordTestLogic extends BaseLogic
public function __construct()
{
$this->model = new DicePlayRecordTest();
// 默认按 id 倒序,保证列表默认显示最新记录
$this->setOrderField('id')->setOrderType('DESC');
}
}

View File

@@ -156,4 +156,12 @@ class DicePlayRecordTest extends BaseModel
$query->where('roll_number', '=', $value);
}
}
/** 关联 dice_reward_config_record.id权重测试记录 */
public function searchRewardConfigRecordIdAttr($query, $value)
{
if ($value !== '' && $value !== null) {
$query->where('reward_config_record_id', '=', $value);
}
}
}