From 1c78e447462bd107c0aa6b94e06e87f60c53745d Mon Sep 17 00:00:00 2001 From: timerzz Date: Sat, 15 Jun 2024 21:51:41 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=9B=9E=E6=BB=9Apid=20gorm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/product/model.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"` //计算价格的过程