- GetUsers添加userID参数
This commit is contained in:
@@ -88,7 +88,7 @@ func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.A
|
||||
}
|
||||
if err = CreateUser(user); err == nil {
|
||||
if outAuthInfo, err = auth2.BindUser(mobileAuth, user); err == nil && inAuthInfo != nil {
|
||||
err = auth2.AddAuthBind(outAuthInfo, inAuthInfo)
|
||||
err = auth2.AddAuthBind(&outAuthInfo.UserBasic, inAuthInfo)
|
||||
}
|
||||
} else if dao.IsDuplicateError(err) {
|
||||
errCode = model.ErrCodeUserAlreadyExist
|
||||
@@ -153,6 +153,6 @@ func OnDingDingMsg(msg map[string]interface{}) (callbackResponse *dingdingapi.Ca
|
||||
return api.DingDingAPI.Err2CallbackResponse(nil)
|
||||
}
|
||||
|
||||
func GetUsers(ctx *jxcontext.Context, userType int, userID2, mobile, userName string) (userList []*model.User, err error) {
|
||||
return dao.GetUsers(dao.GetDB(), userType, userID2, mobile, userName)
|
||||
func GetUsers(ctx *jxcontext.Context, userType int, userID, userID2, mobile, userName string) (userList []*model.User, err error) {
|
||||
return dao.GetUsers(dao.GetDB(), userType, userID, userID2, mobile, userName)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func GetUserByID(db *DaoDB, fieldName, fieldValue string) (user *model.User, err
|
||||
return user, err
|
||||
}
|
||||
|
||||
func GetUsers(db *DaoDB, userType int, userID2, mobile, userName string) (userList []*model.User, err error) {
|
||||
func GetUsers(db *DaoDB, userType int, userID, userID2, mobile, userName string) (userList []*model.User, err error) {
|
||||
if userType == 0 {
|
||||
userType = 255
|
||||
}
|
||||
@@ -35,6 +35,10 @@ func GetUsers(db *DaoDB, userType int, userID2, mobile, userName string) (userLi
|
||||
utils.DefaultTimeValue,
|
||||
userType,
|
||||
}
|
||||
if userID != "" {
|
||||
sql += " AND t1.user_id = ?"
|
||||
sqlParams = append(sqlParams, userID)
|
||||
}
|
||||
if userID2 != "" {
|
||||
sql += " AND t1.user_id2 = ?"
|
||||
sqlParams = append(sqlParams, userID2)
|
||||
|
||||
@@ -54,8 +54,9 @@ func (c *User2Controller) GetBindAuthInfo() {
|
||||
// @Title 得到用户列表
|
||||
// @Description 得到用户列表
|
||||
// @Param token header string true "认证token"
|
||||
// @Param userType query int true "用户类型"
|
||||
// @Param userID2 query string faslse "用户id2"
|
||||
// @Param userType query int true "用户类型(0表示全部)"
|
||||
// @Param userID query string faslse "用户id,必须全匹配(内部唯一标识)"
|
||||
// @Param userID2 query string faslse "用户id2,必须全匹配(外部唯一标识)"
|
||||
// @Param mobile query string faslse "用户手机,必须全匹配"
|
||||
// @Param userName query string faslse "用户名,可以部分匹配"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
@@ -63,7 +64,7 @@ func (c *User2Controller) GetBindAuthInfo() {
|
||||
// @router /GetUsers [get]
|
||||
func (c *User2Controller) GetUsers() {
|
||||
c.callGetUsers(func(params *tUser2GetUsersParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.GetUsers(params.Ctx, params.UserType, params.UserID2, params.Mobile, params.UserName)
|
||||
retVal, err = cms.GetUsers(params.Ctx, params.UserType, params.UserID, params.UserID2, params.Mobile, params.UserName)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user