From 4c723d4531f6823b543900cc3a367e5708e2d203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E4=BF=8A=E6=88=90?= Date: Thu, 21 Sep 2023 15:08:16 +0800 Subject: [PATCH] =?UTF-8?q?sku=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/mall.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model/mall.go b/model/mall.go index 7afd7d6..5d2b839 100644 --- a/model/mall.go +++ b/model/mall.go @@ -260,7 +260,9 @@ func (m *GoodsDetailReq) GoodsDetail() (*Goods, error) { return nil, err } var goodsAttributes []GoodsAttribute - err = DB.Table("goods_attribute").Where("goods_id=?", m.GoodsId). + err = DB.Table("goods_attribute"). + Where("goods_id=?", m.GoodsId). + Order("sort DESC"). Find(&goodsAttributes).Error if err != nil { log.Error().Msgf("goods attribute err:%#v", err)