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)