diff --git a/model/product/model.go b/model/product/model.go index 51ee553..fcd1b73 100644 --- a/model/product/model.go +++ b/model/product/model.go @@ -37,14 +37,14 @@ type Product struct { DeletedAt gorm.DeletedAt `gorm:"index"` Name string `gorm:"index" json:"name"` - Pid string `gorm:"index:,unique,composite:product_pid_website_idx;not null;index:,unique" json:"pid"` + Pid string `gorm:"unique;not null" json:"pid"` Color string `json:"color"` Link string `json:"link"` Image string `json:"image"` Orderable bool `json:"orderable"` OriginalPrice float64 `json:"originalPrice"` - Website Website `json:"website" gorm:"index:,unique,composite:product_pid_website_idx"` + Website Website `json:"website"` DiscPercent int `json:"discPercent" gorm:"index"` //折扣力度 CNYPrice float64 `json:"cnyPrice"` // 最终的价格 CalMark string `json:"calMark"` //计算价格的过程