package model import "bkb-seller/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"` // 商品编号 StoreNo string `gorm:"type:varchar(60);" json:"store_no"` // 店铺编号 CreateBy string `gorm:"size:64" json:"create_by"` // 创建人 } type TbGoodsSpecs struct { // sku ID uint `gorm:"AUTO_INCREMENT;PRIMARY_KEY;" json:"id"` // 主键ID TbGoodsSpecsBase Stock int64 `gorm:"type:int(11);" json:"stock"` // 库存 Status int `gorm:"type:tinyint(1);comment:状态 1:正常" json:"status"` // 状态 Code string `json:"code"` // 商品编码 } 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"` // 商品编号 // 标签 Online string `gorm:"type:ENUM('on','off');comment:商品上下架状态" json:"online" form:"online"` // 上下架状态 on/off Code string `json:"code"` // 商品编码 } func (TbGoodsSpecs) TableName() string { return "tb_goods_specs" } func (TbGoodsSpecsDetail) TableName() string { return "tb_goods_specs" }