diff options
author | techknowlogick <techknowlogick@gitea.io> | 2023-01-28 22:45:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-29 11:45:29 +0800 |
commit | e88b529b31696331393e29561bab3c60bf876ee7 (patch) | |
tree | 156c65aa2843b8b933da5611fdc32eb82d8e2c56 /models/issues/issue.go | |
parent | 2b1e47e2a2a5a31a0fc5039ed7dbb192a4a51dd7 (diff) | |
download | gitea-e88b529b31696331393e29561bab3c60bf876ee7.tar.gz gitea-e88b529b31696331393e29561bab3c60bf876ee7.zip |
Issues: add Project filter to issues list and search (#22544)
Currently only a single project like milestone, not multiple like
labels.
Implements #14298
Code by @brechtvl
---------
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Diffstat (limited to 'models/issues/issue.go')
-rw-r--r-- | models/issues/issue.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/issues/issue.go b/models/issues/issue.go index dc9e5c5acd..50c9b77119 100644 --- a/models/issues/issue.go +++ b/models/issues/issue.go @@ -1572,6 +1572,7 @@ type IssueStatsOptions struct { RepoID int64 Labels string MilestoneID int64 + ProjectID int64 AssigneeID int64 MentionedID int64 PosterID int64 @@ -1650,6 +1651,11 @@ func getIssueStatsChunk(opts *IssueStatsOptions, issueIDs []int64) (*IssueStats, sess.And("issue.milestone_id = ?", opts.MilestoneID) } + if opts.ProjectID > 0 { + sess.Join("INNER", "project_issue", "issue.id = project_issue.issue_id"). + And("project_issue.project_id=?", opts.ProjectID) + } + if opts.AssigneeID > 0 { applyAssigneeCondition(sess, opts.AssigneeID) } |