Files
hfb_sys/backend/internal/model/payment.go
T
yml2213 98174c0e33 feat(quality-owner): 增加优质号主、极品专区与无忧租号保险
- 支持保证金余额支付、在线支付开通及后台手动设置审计
- 新增极品专区发布权限、赔付方案与保险结算费率快照
- 优化首页、商品卡和个人中心的优质号主身份展示
2026-11-04 15:04:35 +08:00

43 lines
2.3 KiB
Go

package model
import (
"time"
"gorm.io/datatypes"
)
type PaymentOrder struct {
ID uint64 `gorm:"primaryKey" json:"id"`
PaymentNo string `gorm:"size:64;not null;uniqueIndex" json:"payment_no"`
OrderID uint64 `gorm:"not null;index" json:"order_id"`
OrderNo string `gorm:"size:64;not null;index" json:"order_no"`
BizID uint64 `gorm:"not null;default:0;index:idx_payment_orders_user_biz,priority:3" json:"biz_id"`
UserID uint64 `gorm:"not null;index" json:"user_id"`
PaymentConfigID uint64 `gorm:"not null;default:0;index" json:"payment_config_id"`
Provider string `gorm:"size:32;not null" json:"provider"`
MerchantID string `gorm:"size:32;not null;default:''" json:"merchant_id"`
ThirdOrderID string `gorm:"size:64;not null;uniqueIndex" json:"third_order_id"`
ProviderOrderID string `gorm:"size:64;not null;default:'';index" json:"provider_order_id"`
PayWay string `gorm:"size:16;not null;default:''" json:"pay_way"`
JSPayFlag string `gorm:"column:jspay_flag;size:8;not null;default:''" json:"jspay_flag"`
AmountCent int64 `gorm:"not null;default:0" json:"amount_cent"`
BizType string `gorm:"size:32;not null;default:'order_pay';index" json:"biz_type"`
Status string `gorm:"size:32;not null;default:'created';index" json:"status"`
TDCode string `gorm:"size:512;not null;default:''" json:"td_code"`
JSPayURL string `gorm:"column:jspay_url;size:512;not null;default:''" json:"jspay_url"`
JSPayInfo string `gorm:"column:jspay_info;type:text" json:"jspay_info"`
RawRequest datatypes.JSON `json:"raw_request"`
RawResponse datatypes.JSON `json:"raw_response"`
RetryCount int `gorm:"not null;default:0" json:"retry_count"`
LastRetryAt *time.Time `json:"last_retry_at"`
NextRetryAt *time.Time `json:"next_retry_at"`
PaidAt *time.Time `json:"paid_at"`
NotifiedAt *time.Time `json:"notified_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (PaymentOrder) TableName() string {
return "payment_orders"
}