aboutsummaryrefslogtreecommitdiffstats
path: root/models/issues/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issues/issue.go')
-rw-r--r--models/issues/issue.go6
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)
}