35 lines
2.2 KiB
Go
35 lines
2.2 KiB
Go
package mysqlmodel
|
|
|
|
type Order struct {
|
|
Model
|
|
// OrderNo 商户订单号;唯一索引保证订单号全局唯一。
|
|
OrderNo string `gorm:"column:order_no;uniqueIndex:uk_order_no"`
|
|
UserID int64 `gorm:"column:user_id"` // 下单用户ID
|
|
GoodsID int64 `gorm:"column:goods_id"` // 关联商品ID
|
|
GoodsName string `gorm:"column:goods_name"` // 商品名称快照
|
|
UnitPrice int64 `gorm:"column:unit_price"` // 商品单价(分)
|
|
TotalAmount int64 `gorm:"column:total_amount"` // 订单总金额(分)
|
|
PayAmount int64 `gorm:"column:pay_amount"` // 实付金额(分)
|
|
PayChannel int8 `gorm:"column:pay_channel"` // 支付渠道 1=微信支付
|
|
OrderStatus int8 `gorm:"column:order_status"` // 订单状态 1=待支付 2=已支付 3=已取消 4=已过期 5=已退款
|
|
TransactionID string `gorm:"column:transaction_id"` // 微信支付流水号
|
|
MemberDays int64 `gorm:"column:member_days"` // 购买的会员天数(快照)
|
|
CosQuota int64 `gorm:"column:cos_quota"` // 赠送上传额度(快照)
|
|
AIRecommendQuota int64 `gorm:"column:ai_recommend_quota"` // 赠送AI推荐额度(快照)
|
|
ClosetShareQuota int64 `gorm:"column:closet_share_quota"` // 赠送衣柜分享额度(快照)
|
|
OutfitShareQuota int64 `gorm:"column:outfit_share_quota"` // 赠送搭配分享额度(快照)
|
|
ExpireTime int64 `gorm:"column:expire_time"` // 支付过期时间
|
|
PayTime int64 `gorm:"column:pay_time"` // 支付完成时间
|
|
RefundTime int64 `gorm:"column:refund_time"` // 退款时间
|
|
RefundAmount int64 `gorm:"column:refund_amount"` // 退款金额(分)
|
|
Remark string `gorm:"column:remark"` // 订单备注
|
|
CallbackRaw string `gorm:"column:callback_raw"` // 支付回调原始报文
|
|
XPayProductID string `gorm:"column:xpay_product_id"` // 虚拟支付道具ID(快照,pay_channel=2 时使用)
|
|
XPayPlatform string `gorm:"column:xpay_platform"` // 虚拟支付平台 android/ios/harmony/windows
|
|
XPayEnv int8 `gorm:"column:xpay_env"` // 虚拟支付环境 0=现网 1=沙箱
|
|
}
|
|
|
|
func (Order) TableName() string {
|
|
return "orders"
|
|
}
|