mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-16 23:27:40 +02:00
[models/search-options] add GroupID to SearchRepoOptions
This commit is contained in:
parent
2f7ecb1f60
commit
09b5fa6e87
@ -158,6 +158,7 @@ type SearchRepoOptions struct {
|
|||||||
OwnerID int64
|
OwnerID int64
|
||||||
PriorityOwnerID int64
|
PriorityOwnerID int64
|
||||||
TeamID int64
|
TeamID int64
|
||||||
|
GroupID int64
|
||||||
OrderBy db.SearchOrderBy
|
OrderBy db.SearchOrderBy
|
||||||
Private bool // Include private repositories in results
|
Private bool // Include private repositories in results
|
||||||
StarredByID int64
|
StarredByID int64
|
||||||
@ -445,6 +446,9 @@ func SearchRepositoryCondition(opts SearchRepoOptions) builder.Cond {
|
|||||||
if opts.TeamID > 0 {
|
if opts.TeamID > 0 {
|
||||||
cond = cond.And(builder.In("`repository`.id", builder.Select("`team_repo`.repo_id").From("team_repo").Where(builder.Eq{"`team_repo`.team_id": opts.TeamID})))
|
cond = cond.And(builder.In("`repository`.id", builder.Select("`team_repo`.repo_id").From("team_repo").Where(builder.Eq{"`team_repo`.team_id": opts.TeamID})))
|
||||||
}
|
}
|
||||||
|
if opts.GroupID > 0 {
|
||||||
|
cond = cond.And(builder.Eq{"`repository`.group_id": opts.GroupID})
|
||||||
|
}
|
||||||
|
|
||||||
if opts.Keyword != "" {
|
if opts.Keyword != "" {
|
||||||
// separate keyword
|
// separate keyword
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user