From 6524349ab4e92d76311ffe1160db2497ce053b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 21 Aug 2023 18:42:36 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/user2.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index b9e6926ee..aabc2de84 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -497,11 +497,12 @@ func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeL storeIDs = append(storeIDs, v.StoreID) } } - globals.SugarLogger.Debugf("====roleList := %s", utils.Format4Output(roleList, false)) - globals.SugarLogger.Debugf("====storeIDs := %s", utils.Format4Output(storeIDs, false)) - globals.SugarLogger.Debugf("====shortRoleNameList := %s", utils.Format4Output(shortRoleNameList, false)) + + if len(storeIDs) == model.NO && len(shortRoleNameList) == model.NO { + return nil, nil + } + storeList, err = dao.GetStoreListByMobileOrStoreIDs(dao.GetDB(), mobileNum, shortRoleNameList, storeIDs) - globals.SugarLogger.Debugf("====storeList := %s", utils.Format4Output(shortRoleNameList, false)) return storeList, err } @@ -518,8 +519,8 @@ func GetMyStoreListNew(ctx *jxcontext.Context, version string) (storesInfo inter } } mobile, userID := ctx.GetMobileAndUserID() - if mobile == "" { - return nil, "", fmt.Errorf("不能得到用户手机号") + if mobile == "" || userID == "" || userID == "null" || userID == "NULL" { + return nil, "", fmt.Errorf("不能得到用户手机号,%s,%s", userID, mobile) } var storeList []*dao.StoreWithCityName if storeList, err = GetStoreList4User(ctx, mobile, userID); err == nil && len(storeList) > 0 {