1.优化一键测试权重时每次压注的底注为随机
This commit is contained in:
@@ -157,17 +157,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatAnteCell(row: Record<string, unknown>): string {
|
function formatAnteCell(row: Record<string, unknown>): string {
|
||||||
const ante = row.ante
|
|
||||||
if (ante === null || ante === undefined || ante === '') {
|
|
||||||
return t('page.detail.dash')
|
|
||||||
}
|
|
||||||
const snap = row.tier_weights_snapshot
|
const snap = row.tier_weights_snapshot
|
||||||
const isRandom =
|
const isRandom =
|
||||||
snap &&
|
snap &&
|
||||||
typeof snap === 'object' &&
|
typeof snap === 'object' &&
|
||||||
(snap as { ante_random?: boolean }).ante_random === true
|
(snap as { ante_random?: boolean }).ante_random === true
|
||||||
const base = String(ante)
|
if (isRandom) {
|
||||||
return isRandom ? `${base} (${t('page.table.anteRandom')})` : base
|
return t('page.table.anteRandom')
|
||||||
|
}
|
||||||
|
const ante = row.ante
|
||||||
|
if (ante === null || ante === undefined || ante === '') {
|
||||||
|
return t('page.detail.dash')
|
||||||
|
}
|
||||||
|
return String(ante)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平台赚取金额展示(未完成或空显示 —)
|
// 平台赚取金额展示(未完成或空显示 —)
|
||||||
|
|||||||
@@ -306,17 +306,19 @@
|
|||||||
|
|
||||||
function formatAnteDetail(record: RecordRow | null): string {
|
function formatAnteDetail(record: RecordRow | null): string {
|
||||||
if (!record) return t('page.detail.dash')
|
if (!record) return t('page.detail.dash')
|
||||||
const ante = record.ante
|
|
||||||
if (ante === null || ante === undefined) {
|
|
||||||
return t('page.detail.dash')
|
|
||||||
}
|
|
||||||
const snap = record.tier_weights_snapshot
|
const snap = record.tier_weights_snapshot
|
||||||
const isRandom =
|
const isRandom =
|
||||||
snap &&
|
snap &&
|
||||||
typeof snap === 'object' &&
|
typeof snap === 'object' &&
|
||||||
(snap as { ante_random?: boolean }).ante_random === true
|
(snap as { ante_random?: boolean }).ante_random === true
|
||||||
const base = String(ante)
|
if (isRandom) {
|
||||||
return isRandom ? `${base} (${t('page.table.anteRandom')})` : base
|
return t('page.table.anteRandom')
|
||||||
|
}
|
||||||
|
const ante = record.ante
|
||||||
|
if (ante === null || ante === undefined) {
|
||||||
|
return t('page.detail.dash')
|
||||||
|
}
|
||||||
|
return String(ante)
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatTestCountDisplay(record: RecordRow | null): string {
|
function formatTestCountDisplay(record: RecordRow | null): string {
|
||||||
|
|||||||
@@ -215,8 +215,12 @@ class WeightTestRunner
|
|||||||
$isPaid = $item[0] === 'paid';
|
$isPaid = $item[0] === 'paid';
|
||||||
$dir = $item[1];
|
$dir = $item[1];
|
||||||
$playAnte = (int) $item[2];
|
$playAnte = (int) $item[2];
|
||||||
if ($isPaid && $anteRandom) {
|
if ($isPaid) {
|
||||||
$playAnte = $this->pickRandomAnteMult($deptId);
|
if ($anteRandom) {
|
||||||
|
$playAnte = $this->pickRandomAnteMult($deptId);
|
||||||
|
} elseif ($playAnte <= 0) {
|
||||||
|
$playAnte = $ante > 0 ? $ante : 1;
|
||||||
|
}
|
||||||
} elseif ($playAnte <= 0) {
|
} elseif ($playAnte <= 0) {
|
||||||
$playAnte = $ante > 0 ? $ante : 1;
|
$playAnte = $ante > 0 ? $ante : 1;
|
||||||
}
|
}
|
||||||
@@ -244,6 +248,8 @@ class WeightTestRunner
|
|||||||
}
|
}
|
||||||
|
|
||||||
$row = $playLogic->simulateOnePlay($cfg, $dir, $lotteryType, $playAnte, $customWeights, $deptId);
|
$row = $playLogic->simulateOnePlay($cfg, $dir, $lotteryType, $playAnte, $customWeights, $deptId);
|
||||||
|
// 明细底注必须为 dice_ante_config.mult(随机模式每局独立抽取后的值)
|
||||||
|
$row['ante'] = $playAnte;
|
||||||
$winCoin = (float) ($row['win_coin'] ?? 0);
|
$winCoin = (float) ($row['win_coin'] ?? 0);
|
||||||
$paidAmount = (float) ($row['paid_amount'] ?? 0);
|
$paidAmount = (float) ($row['paid_amount'] ?? 0);
|
||||||
$perPlayProfit = $isPaid ? ($winCoin - $paidAmount) : $winCoin;
|
$perPlayProfit = $isPaid ? ($winCoin - $paidAmount) : $winCoin;
|
||||||
|
|||||||
Reference in New Issue
Block a user