package model import "time" type TempGoodsOrderMobile struct { ID int64 `orm:"column(id)" json:"-"` VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"` VendorID int `orm:"column(vendor_id)" json:"vendorID"` AccountNo string `orm:"size(32)" json:"accountNo"` OrderCreatedAt time.Time `orm:"type(datetime);index" json:"orderCreatedAt"` // 这里记录的是订单生效时间,即用户支付完成(货到付款即为下单时间) CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"` Mobile string `orm:"size(32);index" json:"mobile"` } func (o *TempGoodsOrderMobile) TableUnique() [][]string { return [][]string{ []string{"VendorOrderID", "VendorID"}, } }