package model import "shop-api/global" type TbGoodsSpecsBase struct { GoodsId uint `gorm:"type:int(11)" json:"goods_id"` // spu 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"` // 规格 Price float64 `gorm:"type:decimal(10,2);" json:"price"` // 价格 Image string `gorm:"size:255" json:"image"` // 规格图片url GoodsNo string `gorm:"size:255" json:"goods_no"` // 商品编号 Code string `gorm:"size:100" json:"code"` // 商品规格属性值定位码 } type TbGoodsSpecs struct { // sku global.MG_MODEL TbGoodsSpecsBase Stock int64 `gorm:"type:int(11);" json:"stock"` // 库存 Status int `gorm:"type:tinyint(1);comment:状态 1:正常" json:"status"` // 状态 } type TbGoodsSpecsDetail struct { global.MG_MODEL GoodsId uint `json:"goods_id"` Specs string `json:"specs"` // 规格 Attributes []TbAttributeDetail `gorm:"-" json:"attributes"` // 规格详情 SkuNo string `json:"sku_no"` // 商品编码 Stock int64 `json:"stock"` // 库存 Price float64 `json:"price"` // 价格 Image string `json:"image"` // 规格图片url GoodsNo string `json:"goods_no"` // 商品编号 } func (TbGoodsSpecs) TableName() string { return "tb_goods_specs" } func (TbGoodsSpecsDetail) TableName() string { return "tb_goods_specs" }