Files
thebet365/packages/shared/src/walletTx.js
Mars d3c211411b feat(admin+api+player): 优胜赛结算态、禁止新增单场与钱包流水展示优化
- API/管理端:优胜赛 SETTLED 后禁止新增单场,列表与子页展示结算状态
- 玩家端:已结算 outright 只读展示并高亮冠军
- 管理端:结算后 stale 标记驱动列表刷新;财务流水时间与备注 i18n 优化
- shared:txDisplayAmount 与 LEAGUE_OUTRIGHT_SETTLED 错误码
2026-06-23 12:20:40 +08:00

12 lines
540 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** 钱包流水展示用金额:输单结算 amount 为 0可用余额未变用冻结差额表示亏损 */
export function txDisplayAmount(tx) {
const type = tx.transactionType.toUpperCase();
const amt = parseFloat(tx.amount);
if (type === 'BET_SETTLE_LOSE' && amt === 0 && tx.frozenBefore != null && tx.frozenAfter != null) {
const frozenDelta = parseFloat(tx.frozenBefore) - parseFloat(tx.frozenAfter);
if (frozenDelta > 0)
return (-frozenDelta).toString();
}
return tx.amount;
}