统一结账押金字段为押金赔付扣除
号主修正去掉无效的其他押金扣款,仅保留押金赔付扣除; 前后端与账单文案统一,修正时 other 与 deduct 对齐。
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user