mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
chore: Remove UsersInTeamsCount
- Introduced in9681c83734and removed inbac4b78e09.
This commit is contained in:
parent
d2701877c0
commit
e2dfdcdabd
3 changed files with 0 additions and 26 deletions
|
|
@ -76,14 +76,3 @@ func GetTeamMembers(ctx context.Context, opts *SearchMembersOptions) ([]*user_mo
|
|||
func IsUserInTeams(ctx context.Context, userID int64, teamIDs []int64) (bool, error) {
|
||||
return db.GetEngine(ctx).Where("uid=?", userID).In("team_id", teamIDs).Exist(new(TeamUser))
|
||||
}
|
||||
|
||||
// UsersInTeamsCount counts the number of users which are in userIDs and teamIDs
|
||||
func UsersInTeamsCount(ctx context.Context, userIDs, teamIDs []int64) (int64, error) {
|
||||
var ids []int64
|
||||
if err := db.GetEngine(ctx).In("uid", userIDs).In("team_id", teamIDs).
|
||||
Table("team_user").
|
||||
Cols("uid").GroupBy("uid").Find(&ids); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int64(len(ids)), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue