统一结账押金字段为押金赔付扣除

号主修正去掉无效的其他押金扣款,仅保留押金赔付扣除;
前后端与账单文案统一,修正时 other 与 deduct 对齐。
This commit is contained in:
yml2213
2026-07-17 17:17:29 +08:00
parent c492a1cc85
commit 98772867a7
8 changed files with 25 additions and 42 deletions
@@ -337,7 +337,7 @@ func buildArbitrationHandoffContent(req ArbitrateRequest, settlement arbitration
content += "\n结算给号主:" + money.FormatWithSymbol(settlement.OwnerIncomeAmountCent)
}
if settlement.DepositDeductAmountCent > 0 {
content += "\n押金扣除:" + money.FormatWithSymbol(settlement.DepositDeductAmountCent)
content += "\n押金赔付扣除:" + money.FormatWithSymbol(settlement.DepositDeductAmountCent)
}
return content
}
+6 -1
View File
@@ -139,7 +139,12 @@ func (r *Repository) CounterCheckout(ctx context.Context, userID uint64, orderID
First(&checkout).Error; err != nil {
return err
}
next, err := buildCheckout(order, checkout.InitiatedBy, checkoutStatusCountered, checkout.Content, req.EvidenceURLS, req.ConsumableAmountCent, req.CoinConsumedM, req.OtherAmountCent, req.DepositDeductAmountCent, true)
// 号主修正只认押金赔付扣除;other 与 deduct 对齐,避免双字段语义分裂
depositDeductCent := req.DepositDeductAmountCent
if depositDeductCent <= 0 && req.OtherAmountCent > 0 {
depositDeductCent = req.OtherAmountCent
}
next, err := buildCheckout(order, checkout.InitiatedBy, checkoutStatusCountered, checkout.Content, req.EvidenceURLS, req.ConsumableAmountCent, req.CoinConsumedM, depositDeductCent, depositDeductCent, true)
if err != nil {
return err
}