- fix bug in GetUsers

This commit is contained in:
gazebo
2019-08-06 17:01:51 +08:00
parent a0c74cf02a
commit 447237f252
4 changed files with 5 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs []string, userID2
}
if keyword != "" {
keywordLike := "%" + keyword + "%"
sql += " AND (t1.user_id2 LIKE % OR t1.mobile LIKE % OR t1.email LIKE ? OR t1.name LIKE ?)"
sql += " AND (t1.user_id2 LIKE ? OR t1.mobile LIKE ? OR t1.email LIKE ? OR t1.name LIKE ?)"
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike)
}
err = GetRows(db, &userList, sql, sqlParams...)

View File

@@ -240,10 +240,10 @@ func (c *Auth2Controller) AddAuthBind() {
// @Title 删除认证方式
// @Description 删除认证方式
// @Param token header string true "认证token"
// @Param authType formData string true "登录类型参见Login的描述"
// @Param authType query string true "登录类型参见Login的描述"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /RemoveAuthBind [post]
// @router /RemoveAuthBind [delete]
func (c *Auth2Controller) RemoveAuthBind() {
c.callRemoveAuthBind(func(params *tAuth2RemoveAuthBindParams) (retVal interface{}, errCode string, err error) {
authInfo, err2 := params.Ctx.GetV2AuthInfo()

View File

@@ -65,7 +65,7 @@ func (c *User2Controller) GetBindAuthInfo() {
func (c *User2Controller) GetUsers() {
c.callGetUsers(func(params *tUser2GetUsersParams) (retVal interface{}, errCode string, err error) {
var userIDs []string
if err := jxutils.Strings2Objs(params.UserIDs, &userIDs); err == nil {
if err = jxutils.Strings2Objs(params.UserIDs, &userIDs); err == nil {
retVal, err = cms.GetUsers(params.Ctx, params.UserType, params.Keyword, userIDs, params.UserID2, params.Mobile)
}
return retVal, "", err

View File

@@ -146,7 +146,7 @@ func init() {
beego.ControllerComments{
Method: "RemoveAuthBind",
Router: `/RemoveAuthBind`,
AllowHTTPMethods: []string{"post"},
AllowHTTPMethods: []string{"delete"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})