fix(server/pay): 订单展示金额兜底 — 老单 amount_minor=0 回退档位展示价(按方式结算币种)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
@@ -165,6 +165,14 @@ func orderViewFromRow(row *PurchaseRow) orderView {
|
||||
}
|
||||
if it, ok := CatalogBySKU(row.SKU); ok {
|
||||
v.Plan, v.Days = it.Plan, it.Days
|
||||
// 展示金额兜底:老单/webhook 前 amount_minor=0(旧下单不落金额)→ 按档位+
|
||||
// 支付方式的结算币种回退到展示价,列表/详情不再显 0。webhook 到账后为实际金额,不触发。
|
||||
if v.AmountMinor == 0 {
|
||||
v.AmountMinor = DisplayAmountMinor(it, row.Method)
|
||||
if v.Currency == "" {
|
||||
v.Currency = SettlementCurrency(row.Method)
|
||||
}
|
||||
}
|
||||
}
|
||||
if row.PaidAt.Valid {
|
||||
s := row.PaidAt.Time.UTC().Format(time.RFC3339)
|
||||
|
||||
Reference in New Issue
Block a user