package model import "bkb-seller/global" type OrderGoods struct { global.MG_MODEL OrderID string `gorm:"size:50" json:"orderID"` // 订单id SpuNo string `gorm:"type:varchar(60);" json:"spu_no"` // 商品编号 SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` // 商品规格编号 Specs string `gorm:"type:text;" json:"specs"` // 规格 TbGoodsBase } type OrderGoodsDetail struct { OrderGoods Sales int64 `gorm:"-" json:"sales"` //总销售量 Sales30 int64 `gorm:"-" json:"sales_30"` //30天销售量 GoodsSpecs []OrderGoodsSpecs `gorm:"ForeignKey:ID;AssociationForeignKey:OrderGoodsId" json:"goods_specs"` // 商品规格 } func (OrderGoods) TableName() string { return "order_goods" } func (OrderGoodsDetail) TableName() string { return "order_goods" }