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 {