mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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)
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user