diff options
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/models/issue.go b/models/issue.go index 4ceb586b45..1e49fda754 100644 --- a/models/issue.go +++ b/models/issue.go @@ -639,7 +639,7 @@ func parseCountResult(results []map[string][]byte) int64 { } // GetIssueStats returns issue statistic information by given conditions. -func GetIssueStats(repoID, uid, labelID, milestoneID int64, isShowClosed bool, filterMode int) *IssueStats { +func GetIssueStats(repoID, uid, labelID, milestoneID, assigneeID int64, isShowClosed bool, filterMode int) *IssueStats { stats := &IssueStats{} // issue := new(Issue) @@ -652,20 +652,16 @@ func GetIssueStats(repoID, uid, labelID, milestoneID int64, isShowClosed bool, f if milestoneID > 0 { baseCond += " AND issue.milestone_id=" + com.ToStr(milestoneID) } + if assigneeID > 0 { + baseCond += " AND assignee_id=" + com.ToStr(assigneeID) + } switch filterMode { - case FM_ALL: + case FM_ALL, FM_ASSIGN: resutls, _ := x.Query(queryStr+baseCond, repoID, false) stats.OpenCount = parseCountResult(resutls) resutls, _ = x.Query(queryStr+baseCond, repoID, true) stats.ClosedCount = parseCountResult(resutls) - case FM_ASSIGN: - baseCond += " AND assignee_id=?" - resutls, _ := x.Query(queryStr+baseCond, repoID, false, uid) - stats.OpenCount = parseCountResult(resutls) - resutls, _ = x.Query(queryStr+baseCond, repoID, true, uid) - stats.ClosedCount = parseCountResult(resutls) - case FM_CREATE: baseCond += " AND poster_id=?" resutls, _ := x.Query(queryStr+baseCond, repoID, false, uid) |