package model import "pure-admin/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"` // 商品编号 } 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"` //规格 SkuNo string `json:"sku_no"` //商品编码 Stock int64 `json:"stock"` //库存 Price float64 `json:"price"` //价格 Image string `json:"image"` //规格图片url GoodsNo string `json:"goods_no"` //商品编号 Tags string `gorm:"type:varchar(255);" json:"tags"` //标签 Online string `gorm:"type:ENUM('on','off');comment:商品上下架状态" json:"online" form:"online"` //上下架状态 on/off } func (TbGoodsSpecs) TableName() string { return "tb_goods_specs" } func (TbGoodsSpecsDetail) TableName() string { return "tb_goods_specs" }