diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 474b290a9..c2c496bd8 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -485,13 +485,7 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo t3.id store_id, t1.id name_id ` + sql + ` GROUP BY 1, 2 - ` - if isHighPrice { - sql2 += " ORDER BY t4.unit_price DESC" - } else { - sql2 += " ORDER BY 1, 2" - } - sql2 += ` + ORDER BY 1, 2 LIMIT ? OFFSET ? ` sqlParams2 := append([]interface{}{}, sqlParams...) @@ -536,6 +530,9 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo t4.status_sale_begin, t4.status_sale_end, t6.mid_unit_price real_mid_unit_price ` + sql + if isHighPrice { + sql += " , t4.unit_price DESC" + } var tmpList []*tGetStoresSkusInfo beginTime := time.Now() if err = dao.GetRows(db, &tmpList, sql, sqlParams...); err != nil {