26 lines
1.5 KiB
Go
26 lines
1.5 KiB
Go
package model
|
||
|
||
import "time"
|
||
|
||
// Order 对应表 orders,JSON 输出与现网接口 1:1(小写驼峰)
|
||
type Order struct {
|
||
ID string `gorm:"column:id;primaryKey;size:50" json:"id"`
|
||
OrderSN string `gorm:"column:order_sn;uniqueIndex;size:50" json:"orderSn"`
|
||
UserID string `gorm:"column:user_id;size:50" json:"userId"`
|
||
OpenID string `gorm:"column:open_id;size:100" json:"openId"`
|
||
ProductType string `gorm:"column:product_type;size:50" json:"productType"`
|
||
ProductID *string `gorm:"column:product_id;size:50" json:"productId,omitempty"`
|
||
Amount float64 `gorm:"column:amount;type:decimal(10,2)" json:"amount"`
|
||
Description *string `gorm:"column:description;size:200" json:"description,omitempty"`
|
||
Status *string `gorm:"column:status;size:20" json:"status,omitempty"`
|
||
TransactionID *string `gorm:"column:transaction_id;size:100" json:"transactionId,omitempty"`
|
||
PayTime *time.Time `gorm:"column:pay_time" json:"payTime,omitempty"`
|
||
ReferralCode *string `gorm:"column:referral_code;size:255" json:"referralCode,omitempty"`
|
||
ReferrerID *string `gorm:"column:referrer_id;size:255" json:"referrerId,omitempty"`
|
||
RefundReason *string `gorm:"column:refund_reason;size:500" json:"refundReason,omitempty"`
|
||
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
|
||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
|
||
}
|
||
|
||
func (Order) TableName() string { return "orders" }
|