mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add issue filter for Author (#20578)
This adds a new filter option on the issues and pulls pages to filter by the author/poster/creator of the issue or PR
This commit is contained in:
		@@ -170,3 +170,15 @@ func GetReviewers(ctx context.Context, repo *Repository, doerID, posterID int64)
 | 
			
		||||
	users := make([]*user_model.User, 0, 8)
 | 
			
		||||
	return users, db.GetEngine(ctx).Where(cond).OrderBy(user_model.GetOrderByName()).Find(&users)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetIssuePosters returns all users that have authored an issue/pull request for the given repository
 | 
			
		||||
func GetIssuePosters(ctx context.Context, repo *Repository, isPull bool) ([]*user_model.User, error) {
 | 
			
		||||
	users := make([]*user_model.User, 0, 8)
 | 
			
		||||
	cond := builder.In("`user`.id",
 | 
			
		||||
		builder.Select("poster_id").From("issue").Where(
 | 
			
		||||
			builder.Eq{"repo_id": repo.ID}.
 | 
			
		||||
				And(builder.Eq{"is_pull": isPull}),
 | 
			
		||||
		).GroupBy("poster_id"),
 | 
			
		||||
	)
 | 
			
		||||
	return users, db.GetEngine(ctx).Where(cond).OrderBy(user_model.GetOrderByName()).Find(&users)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user