summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-05 20:52:17 +0800
committerUnknwon <u@gogs.io>2015-08-05 20:52:17 +0800
commit34795770c337c3bfcc56600a41a9c4bec31d0a8e (patch)
treed696363493307eb70d71813db8e82fc8e2c91830 /models/issue.go
parent81d01aa308142aa368784ecd551601158422650d (diff)
downloadgitea-34795770c337c3bfcc56600a41a9c4bec31d0a8e.tar.gz
gitea-34795770c337c3bfcc56600a41a9c4bec31d0a8e.zip
fix issue stats with milestone filter
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index 9fd53b47f9..80afb415bb 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -426,7 +426,7 @@ const (
)
// GetIssueStats returns issue statistic information by given conditions.
-func GetIssueStats(repoID, uid, labelID int64, isShowClosed bool, filterMode int) *IssueStats {
+func GetIssueStats(repoID, uid, labelID, milestoneID int64, isShowClosed bool, filterMode int) *IssueStats {
stats := &IssueStats{}
issue := new(Issue)
@@ -434,6 +434,9 @@ func GetIssueStats(repoID, uid, labelID int64, isShowClosed bool, filterMode int
if labelID > 0 {
queryStr += " AND issue.label_ids like '%$" + com.ToStr(labelID) + "|%'"
}
+ if milestoneID > 0 {
+ queryStr += " AND milestone_id=" + com.ToStr(milestoneID)
+ }
switch filterMode {
case FM_ALL:
stats.OpenCount, _ = x.Where(queryStr, repoID, false).Count(issue)