aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-15 12:07:08 +0800
committerUnknwon <u@gogs.io>2015-08-15 12:07:08 +0800
commita52324a5f9d2dd8f4d4980d3ea0a2d247471dcff (patch)
treeaff03aaf74ea496092630ca2bcf9d21e2cbeaef6 /models/issue.go
parent4ce003dc15eb4a283b9cc4b19e4a5e2de0b1b89f (diff)
downloadgitea-a52324a5f9d2dd8f4d4980d3ea0a2d247471dcff.tar.gz
gitea-a52324a5f9d2dd8f4d4980d3ea0a2d247471dcff.zip
able sort issues
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go14
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)