From dfa39b8a04869c403d2fd950d3192a16c75eb2a3 Mon Sep 17 00:00:00 2001 From: gazebo Date: Sun, 30 Sep 2018 09:35:32 +0800 Subject: [PATCH] - GetStoreSkus, fromStatus and toStatus only valid when isFoucs is true. --- business/jxstore/cms/store_sku.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 1fe0178e4..44fe07017 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -50,7 +50,7 @@ type tStoreSkuBindAndSpec struct { RealSkuID int `orm:"column(real_sku_id)"` } -func GetStoreSkus(storeID int, isFocused bool, keyword string, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *StoreSkuNamesInfo, err error) { +func GetStoreSkus(storeID int, isFocus bool, keyword string, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *StoreSkuNamesInfo, err error) { db := dao.GetDB() sql := ` FROM sku_name t1 @@ -60,7 +60,7 @@ func GetStoreSkus(storeID int, isFocused bool, keyword string, params map[string LEFT JOIN sku_name_place_bind t5 ON t1.id = t5.name_id AND t3.city_code = t5.place_code WHERE t1.deleted_at = '1970-01-01 00:00:00' AND (t1.is_global = 1 OR t5.id IS NOT NULL OR t4.status = ?) ` - if isFocused { + if isFocus { sql += " AND t4.sku_id IS NOT NULL" } else { sql += " AND t4.sku_id IS NULL" @@ -127,7 +127,7 @@ func GetStoreSkus(storeID int, isFocused bool, keyword string, params map[string sqlParams = append(sqlParams, skuIDs) } } - if params["fromStatus"] != nil { + if isFocus && params["fromStatus"] != nil { fromStatus := params["fromStatus"].(int) toStatus := fromStatus if params["toStatus"] != nil {