|
|
@ -845,23 +845,8 @@ func IsTeamMember(orgId, teamId, uid int64) bool { |
|
|
|
|
|
|
|
|
|
|
|
// GetTeamMembers returns all members in given team of organization.
|
|
|
|
// GetTeamMembers returns all members in given team of organization.
|
|
|
|
func GetTeamMembers(orgId, teamId int64) ([]*User, error) { |
|
|
|
func GetTeamMembers(orgId, teamId int64) ([]*User, error) { |
|
|
|
/*tus := make([]*TeamUser, 0, 10) |
|
|
|
us := make([]*User, 0, 10) |
|
|
|
|
|
|
|
err := x.Sql("SELECT * FROM user JOIN team_user ON team_user.team_id = ? AND team_user.uid = user.id", teamId).Find(&us) |
|
|
|
err := x.Where("org_id=?", orgId).And("team_id=?", teamId).Find(&tus) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return nil, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
us := make([]*User, len(tus)) |
|
|
|
|
|
|
|
for i, tu := range tus { |
|
|
|
|
|
|
|
us[i], err = GetUserById(tu.Uid) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return nil, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
us := make([]*User, 0) |
|
|
|
|
|
|
|
err := x.Sql("select * from user join team_user on team_user.team_id = ? and team_user.uid = user.id", teamId).Find(&us) |
|
|
|
|
|
|
|
return us, err |
|
|
|
return us, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|