feat(backend): license_purchases 增 amount_minor/currency/pay_url/renewed_to 列 + 存量回填(pay v2 金额口径)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-10 20:26:59 +08:00
parent ceabc7977b
commit bc183ab7df
6 changed files with 60 additions and 2 deletions
+5 -1
View File
@@ -10,7 +10,11 @@ type LicensePurchase struct {
ShopID uint64 `gorm:"not null;index" json:"shop_id"`
UserID uint64 `gorm:"not null" json:"user_id"`
ProductBizCode string `gorm:"size:64;not null" json:"product_biz_code"`
Amount string `gorm:"size:16" json:"amount"`
AmountMinor int64 `gorm:"not null;default:0" json:"amount_minor"` // v2 口径:最小单位(CNY=分)
Currency string `gorm:"size:8;not null;default:''" json:"currency"`
PayURL string `gorm:"size:512" json:"pay_url,omitempty"` // v2 session payload.url,订单管理「继续支付」复用
RenewedTo *time.Time `json:"renewed_to,omitempty"` // settle 续期后的授权到期日(订单流水「授权续期至」展示)
Amount string `gorm:"size:16" json:"amount"` // Deprecated: v1 元字符串,只读兜底输出,观察一版后 DROP
OutTradeNo string `gorm:"size:64;uniqueIndex:uk_out_trade_no" json:"out_trade_no"`
Status string `gorm:"type:enum('pending','paid','failed');default:'pending';index" json:"status"`
TradeNo string `gorm:"size:64" json:"trade_no,omitempty"` // 渠道交易号(支付宝/微信)