From d8e7ae17738f886092245fdc9d5b105ed0290d88 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:35:52 +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 71ddf27ee..474b290a9 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -292,22 +292,18 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool sql += ` JOIN store_sku_bind t4 ON t4.store_id = t3.id AND t4.sku_id = t2.id AND t4.deleted_at = ? LEFT JOIN sku_name_place_bind t5 ON t1.id = t5.name_id AND t3.city_code = t5.place_code - LEFT JOIN (SELECT count(*) count,id,city_code FROM store WHERE status = ? GROUP BY 2)te ON te.id = t3.id AND te.city_code = t3.city_code - LEFT JOIN price_refer_snapshot tn ON IF(te.count < 3 ,tn.city_code = 0, tn.city_code = t3.city_code) AND tn.sku_id = t2.id AND tn.snapshot_at = ? LEFT JOIN price_refer_snapshot t6 ON t6.city_code = 0 AND t6.sku_id = t2.id AND t6.snapshot_at = ? WHERE t1.deleted_at = ? AND (t1.is_global = 1 OR t5.id IS NOT NULL OR 1 = ?)/* AND t1.status = ?*/ ` sqlParams = append(sqlParams, []interface{}{ utils.DefaultTimeValue, - model.StoreStatusOpened, - utils.Time2Date(time.Now().AddDate(0, 0, -1)), utils.Time2Date(time.Now().AddDate(0, 0, -1)), utils.DefaultTimeValue, utils.Bool2Int(isFocus), // model.SkuStatusNormal, }) if isHighPrice { - sql += " AND t4.unit_price > tn.mid_unit_price / IF(t3.pay_percentage < 50 , 70, t3.pay_percentage) * 1.2" + sql += " AND t4.unit_price > t6.mid_unit_price / IF(t3.pay_percentage < 50 , 70, t3.pay_percentage) * 1.2" } if isFocus { sql += " AND ((t2.status = ? AND t1.status = ?) OR t4.status = ?)" @@ -489,10 +485,11 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo t3.id store_id, t1.id name_id ` + sql + ` GROUP BY 1, 2 - ORDER BY 1, 2 ` if isHighPrice { - sql2 += " , t4.unit_price DESC" + sql2 += " ORDER BY t4.unit_price DESC" + } else { + sql2 += " ORDER BY 1, 2" } sql2 += ` LIMIT ? OFFSET ?