From d492a2301c46c83ee45c30be101419ce7c53c9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 25 Feb 2020 10:41:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=AB=98=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 {