update query to use alias (#3490)
This commit is contained in:
parent
4b5152940d
commit
347a1deb8f
1 changed files with 3 additions and 3 deletions
|
@ -275,8 +275,8 @@ func (s *MattermostAuthLayer) GetUsersByTeam(teamID string) ([]*model.User, erro
|
|||
Select("u.id", "u.username", "u.email", "u.nickname", "u.firstname", "u.lastname", "u.props", "u.CreateAt as create_at", "u.UpdateAt as update_at",
|
||||
"u.DeleteAt as delete_at", "b.UserId IS NOT NULL AS is_bot").
|
||||
From("Users as u").
|
||||
Join("TeamMembers as tm ON tm.UserID = u.ID").
|
||||
LeftJoin("Bots b ON ( b.UserId = Users.ID )").
|
||||
Join("TeamMembers as tm ON tm.UserID = u.id").
|
||||
LeftJoin("Bots b ON ( b.UserID = u.id )").
|
||||
Where(sq.Eq{"u.deleteAt": 0}).
|
||||
Where(sq.NotEq{"u.roles": "system_guest"}).
|
||||
Where(sq.Eq{"tm.TeamId": teamID})
|
||||
|
@ -300,7 +300,7 @@ func (s *MattermostAuthLayer) GetUsersList(userIDs []string) ([]*model.User, err
|
|||
Select("u.id", "u.username", "u.email", "u.nickname", "u.firstname", "u.lastname", "u.props", "u.CreateAt as create_at", "u.UpdateAt as update_at",
|
||||
"u.DeleteAt as delete_at", "b.UserId IS NOT NULL AS is_bot").
|
||||
From("Users as u").
|
||||
LeftJoin("Bots b ON ( b.UserId = Users.ID )").
|
||||
LeftJoin("Bots b ON ( b.UserId = u.id )").
|
||||
Where(sq.Eq{"u.id": userIDs})
|
||||
|
||||
rows, err := query.Query()
|
||||
|
|
Loading…
Reference in a new issue