You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
3.4 KiB
76 lines
3.4 KiB
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"shop-api/global"
|
|
)
|
|
|
|
// todo 添加购买所在平台字段
|
|
|
|
type Order struct {
|
|
global.MG_MODEL
|
|
Platform string `gorm:"size:10" json:"platform"` // 购买平台
|
|
StoreNo string `gorm:"size:60" json:"store_no"` // 店铺编号
|
|
OrderID string `gorm:"size:50;index" json:"orderID"` // 订单号
|
|
PaypalID string `gorm:"size:50" json:"paypalID"` // paypal订单号
|
|
CaptureID string `gorm:"size:50" json:"captureID"` // paypal收款确认id
|
|
Code string `gorm:"size:20" json:"code"` // 网红领取任务码
|
|
UserID string `gorm:"size:50;index" json:"userID"` // 用户id
|
|
CommodID uint `gorm:"size:50;index" json:"commodID"` // 商品id
|
|
SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` // 商品规格编号
|
|
SkuID int `gorm:"type:int(10);" json:"sku_id"` // 商品规格编号
|
|
Type int `gorm:"type:int(1);default:1" json:"type"` // 类型 1-普通订单 2-预售订单
|
|
Price float64 `gorm:"type:decimal(10,2)" json:"price"` // 商品价格
|
|
Number int `gorm:"type:int(10)" json:"number"` // 数量
|
|
PaidPrice float64 `gorm:"type:decimal(10,2)" json:"paidPrice"` // 实付价格
|
|
Status int `gorm:"type:int(1)" json:"status"` // 订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消
|
|
ExpressStatus int `gorm:"type:int(1)" json:"express_status"` // 物流状态 1:已签收
|
|
PayMode int `gorm:"type:int(1)" json:"payMode"` // 支付方式 1-paypal
|
|
PayTime *time.Time `gorm:"" json:"payTime"` // 付款时间
|
|
SendTime *time.Time `gorm:"" json:"sendTime"` // 发货时间
|
|
ExpressTime *time.Time `gorm:"" json:"express_time"` // 已签收时间
|
|
ConfirmTime *time.Time `gorm:"" json:"confirmTime"` // 收货时间
|
|
}
|
|
|
|
type OrderList struct {
|
|
Order
|
|
NextCountdown int64 `gorm:"-" json:"next_countdown"` // 下阶段倒计时
|
|
Goods OrderGoodsDetail `gorm:"-" json:"goods"` // 商品信息
|
|
PostSale PostSale `gorm:"-" json:"postSale"` // 售后信息
|
|
}
|
|
|
|
type OrderDetail struct {
|
|
Order
|
|
NextCountdown int64 `gorm:"-" json:"next_countdown"` // 下阶段倒计时
|
|
Goods OrderGoodsDetail `gorm:"-" json:"goods"` // 商品信息
|
|
Address OrderAddress `gorm:"-" json:"address"` // 地址
|
|
Deliver OrderDeliver `gorm:"-" json:"deliver"` // 发货信息
|
|
SellerUser SellerUserDesc `gorm:"-" json:"seller"` // 卖家信息
|
|
Store SellerStoreInfo `gorm:"-" json:"store"` // 店铺信息
|
|
Bill BillView `gorm:"-" json:"bill"` // 交易信息
|
|
Chain Chain `gorm:"-" json:"chain"` // 区块链
|
|
PostSale PostSale `gorm:"-" json:"postSale"` // 售后信息
|
|
}
|
|
|
|
type OrderTotal struct {
|
|
Status2 int `json:"status2"` // 待发货
|
|
Status3 int `json:"status3"` // 已发货
|
|
Status4 int `json:"status4"` // 已收货
|
|
}
|
|
|
|
type Chain struct {
|
|
Address string `json:"address"` // 合约地址
|
|
}
|
|
|
|
func (Order) TableName() string {
|
|
return "order"
|
|
}
|
|
|
|
func (OrderList) TableName() string {
|
|
return "order"
|
|
}
|
|
|
|
func (OrderDetail) TableName() string {
|
|
return "order"
|
|
}
|
|
|