2023-09-14 10:43:10 +00:00
|
|
|
|
package gmodel
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// fs_order_trade 订单交易表
|
|
|
|
|
type FsOrderTrade struct {
|
|
|
|
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // 订单交易ID
|
|
|
|
|
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
2023-09-19 11:17:04 +00:00
|
|
|
|
OrderSn *string `gorm:"default:'';" json:"order_sn"` //
|
2023-09-14 10:43:10 +00:00
|
|
|
|
OrderSource *string `gorm:"default:'';" json:"order_source"` //
|
2023-09-19 11:17:04 +00:00
|
|
|
|
TradeSn *string `gorm:"index;default:'';" json:"trade_sn"` //
|
2023-09-14 10:43:10 +00:00
|
|
|
|
PayAmount *int64 `gorm:"default:0;" json:"pay_amount"` // 支付金额 (分)
|
|
|
|
|
PayStatus *int64 `gorm:"default:0;" json:"pay_status"` // 支付状态:1=未成功,2=已成功
|
|
|
|
|
PaymentMethod *int64 `gorm:"default:0;" json:"payment_method"` // 支付方式:1=stripe,2=paypal
|
|
|
|
|
PayStage *int64 `gorm:"default:0;" json:"pay_stage"` // 支付阶段:1=首付,2=尾款
|
|
|
|
|
RefundStatus *int64 `gorm:"default:0;" json:"refund_status"` // 退款状态:1=未退款,2=已退款
|
2023-09-19 11:17:04 +00:00
|
|
|
|
CardSn *string `gorm:"default:'';" json:"card_sn"` //
|
2023-09-14 10:43:10 +00:00
|
|
|
|
CardBrand *string `gorm:"default:'';" json:"card_brand"` //
|
|
|
|
|
Country *string `gorm:"default:'';" json:"country"` //
|
|
|
|
|
Currency *string `gorm:"default:'';" json:"currency"` //
|
|
|
|
|
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
|
|
|
|
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
|
|
|
|
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
|
|
|
|
PayTitle *string `gorm:"default:'';" json:"pay_title"` //
|
2023-10-17 10:32:43 +00:00
|
|
|
|
ReceiptSn *string `gorm:"default:'';" json:"receipt_sn"` //
|
2023-09-14 10:43:10 +00:00
|
|
|
|
}
|
|
|
|
|
type FsOrderTradeModel struct {
|
|
|
|
|
db *gorm.DB
|
|
|
|
|
name string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewFsOrderTradeModel(db *gorm.DB) *FsOrderTradeModel {
|
|
|
|
|
return &FsOrderTradeModel{db: db, name: "fs_order_trade"}
|
|
|
|
|
}
|