diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index f53c283df..e4c1db2da 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -466,16 +466,18 @@ func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeL return storeList, err } -func GetMyStoreListNew(ctx *jxcontext.Context) (storesInfo interface{}, errCode string, err error) { +func GetMyStoreListNew(ctx *jxcontext.Context, mobile string) (storesInfo interface{}, errCode string, err error) { if !auth2.IsV2Token(ctx.GetToken()) { return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid } - mobileNum, userID := ctx.GetMobileAndUserID() - if mobileNum == "" { - return nil, "", fmt.Errorf("不能得到用户手机号") - } + _, userID := ctx.GetMobileAndUserID() + //if mobileNum == "" { + //userID := ctx.GetUserID() + //dao.GetUserByID() + //return nil, "", fmt.Errorf("不能得到用户手机号") + //} var storeList []*dao.StoreWithCityName - if storeList, err = GetStoreList4User(ctx, mobileNum, userID); err == nil && len(storeList) > 0 { + if storeList, err = GetStoreList4User(ctx, mobile, userID); err == nil && len(storeList) > 0 { // todo,应该用通用方法 mapDataList := make([]map[string]interface{}, len(storeList)) for k, v := range storeList { diff --git a/controllers/cms_user2.go b/controllers/cms_user2.go index 1fe797f81..101fbf775 100644 --- a/controllers/cms_user2.go +++ b/controllers/cms_user2.go @@ -89,12 +89,13 @@ func (c *User2Controller) GetUsers() { // @Title 得到用户自己的门店列表 // @Description 得到用户自己的门店列表 // @Param token header string true "认证token" +// @Param mobile query string false "电话" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /GetMyStoreList [get] func (c *User2Controller) GetMyStoreList() { c.callGetMyStoreList(func(params *tUser2GetMyStoreListParams) (retVal interface{}, errCode string, err error) { - retVal, errCode, err = cms.GetMyStoreListNew(params.Ctx) + retVal, errCode, err = cms.GetMyStoreListNew(params.Ctx, params.Mobile) return retVal, errCode, err }) }