From 1dc91f6f9a6ec90420b6853517ce5b2206df49d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 22 Jan 2021 10:23:19 +0800 Subject: [PATCH] aa --- business/jxstore/cms/permission.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/permission.go b/business/jxstore/cms/permission.go index bb8aa5b11..fd825c452 100644 --- a/business/jxstore/cms/permission.go +++ b/business/jxstore/cms/permission.go @@ -323,14 +323,18 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) { if _, ok := brandIDMap[v.BrandID]; !ok { brandIDMap[v.BrandID] = 1 } - for _, cityCode := range jxutils.StrListToIntList(strings.Split(v.CityCodes, ",")) { - if _, ok := cityCodeMap[cityCode]; !ok { - cityCodeMap[cityCode] = 1 + if v.CityCodes != "" { + for _, cityCode := range jxutils.StrListToIntList(strings.Split(v.CityCodes, ",")) { + if _, ok := cityCodeMap[cityCode]; !ok { + cityCodeMap[cityCode] = 1 + } } } - for _, storeID := range jxutils.StrListToIntList(strings.Split(v.StoreIDs, ",")) { - if _, ok := storeIDMap[storeID]; !ok { - storeIDMap[storeID] = 1 + if v.StoreIDs != "" { + for _, storeID := range jxutils.StrListToIntList(strings.Split(v.StoreIDs, ",")) { + if _, ok := storeIDMap[storeID]; !ok { + storeIDMap[storeID] = 1 + } } } }