@@ -10,9 +10,8 @@ import (
10
10
"os"
11
11
"strings"
12
12
13
+ "github.com/go-xorm/builder"
13
14
"github.com/go-xorm/xorm"
14
-
15
- "code.gitea.io/gitea/modules/base"
16
15
)
17
16
18
17
var (
@@ -540,7 +539,7 @@ func (org *User) GetUserRepositories(userID int64, page, pageSize int) ([]*Repos
540
539
Select ("`repository`.*" ).
541
540
Join ("INNER" , "team_repo" , "`team_repo`.repo_id=`repository`.id" ).
542
541
Where ("(`repository`.owner_id=? AND `repository`.is_private=?)" , org .ID , false ).
543
- Or ("team_repo.team_id IN (?) " , strings . Join ( base . Int64sToStrings ( teamIDs ), "," )).
542
+ Or (builder . In ( "team_repo.team_id" , teamIDs )).
544
543
GroupBy ("`repository`.id" ).
545
544
OrderBy ("updated_unix DESC" ).
546
545
Limit (pageSize , (page - 1 )* pageSize ).
@@ -551,7 +550,7 @@ func (org *User) GetUserRepositories(userID int64, page, pageSize int) ([]*Repos
551
550
repoCount , err := x .
552
551
Join ("INNER" , "team_repo" , "`team_repo`.repo_id=`repository`.id" ).
553
552
Where ("(`repository`.owner_id=? AND `repository`.is_private=?)" , org .ID , false ).
554
- Or ("team_repo.team_id IN (?) " , strings . Join ( base . Int64sToStrings ( teamIDs ), "," )).
553
+ Or (builder . In ( "team_repo.team_id" , teamIDs )).
555
554
GroupBy ("`repository`.id" ).
556
555
Count (& Repository {})
557
556
if err != nil {
@@ -577,7 +576,7 @@ func (org *User) GetUserMirrorRepositories(userID int64) ([]*Repository, error)
577
576
Select ("`repository`.*" ).
578
577
Join ("INNER" , "team_repo" , "`team_repo`.repo_id=`repository`.id AND `repository`.is_mirror=?" , true ).
579
578
Where ("(`repository`.owner_id=? AND `repository`.is_private=?)" , org .ID , false ).
580
- Or ("team_repo.team_id IN (?) " , strings . Join ( base . Int64sToStrings ( teamIDs ), "," )).
579
+ Or (builder . In ( "team_repo.team_id" , teamIDs )).
581
580
GroupBy ("`repository`.id" ).
582
581
OrderBy ("updated_unix DESC" ).
583
582
Find (& repos )
0 commit comments