From a20b4b7ec840fe18f5de17bf4bcd2850cd04cd8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E4=BF=8A=E6=88=90?= Date: Wed, 20 Sep 2023 15:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8sku?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/models/mall.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/models/mall.go b/app/admin/models/mall.go index d25708e..0b8525d 100644 --- a/app/admin/models/mall.go +++ b/app/admin/models/mall.go @@ -67,7 +67,7 @@ type Goods struct { PriceVm uint32 `json:"price_vm"` // 积分价格 PriceRm uint32 `json:"price_rm"` // 人民币价格 //Stock uint32 `json:"stock"` // 库存 - ShowDiscount int `json:"show_discount"` //是否展示折扣价 + ShowDiscount int8 `json:"show_discount"` //是否展示折扣价 GoodsCat *GoodsCat `json:"goods_cat" gorm:"-"` GoodsDiscount *GoodsDiscount `json:"goods_discount" gorm:"-"` @@ -1404,7 +1404,7 @@ func (o *GoodsOrder) SetDeliverStore() error { func GetGoodsFirstSkuCombo(goodsId []uint32) []GoodsAttributeCombo { var list []GoodsAttributeCombo err := orm.Eloquent. - Raw("SELECT b.* FROM (SELECT goods_id, MAX(sort) FROM goods_attribute GROUP BY goods_id) AS a INNER JOIN goods_attribute_combo b ON a.goods_id = b.goods_id where a.goods_id in (?) GROUP BY b.goods_id", goodsId). + Raw("SELECT b.* FROM goods_attribute AS a INNER JOIN goods_attribute_combo b ON a.goods_id = b.goods_id where a.goods_id in (?) GROUP BY b.goods_id", goodsId). Scan(&list). Error if err != nil {