summaryrefslogtreecommitdiffstats
path: root/models/repo_activity.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo_activity.go')
-rw-r--r--models/repo_activity.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/repo_activity.go b/models/repo_activity.go
index 839a74a7e6..c3017e8e39 100644
--- a/models/repo_activity.go
+++ b/models/repo_activity.go
@@ -176,7 +176,7 @@ func (stats *ActivityStats) FillIssues(repoID int64, fromTime time.Time) error {
// Closed issues
sess := issuesForActivityStatement(repoID, fromTime, true, false)
- sess.OrderBy("issue.updated_unix DESC")
+ sess.OrderBy("issue.closed_unix DESC")
stats.ClosedIssues = make(IssueList, 0)
if err = sess.Find(&stats.ClosedIssues); err != nil {
return err
@@ -228,7 +228,11 @@ func issuesForActivityStatement(repoID int64, fromTime time.Time, closed, unreso
if !unresolved {
sess.And("issue.is_pull = ?", false)
- sess.And("issue.created_unix >= ?", fromTime.Unix())
+ if closed {
+ sess.And("issue.closed_unix >= ?", fromTime.Unix())
+ } else {
+ sess.And("issue.created_unix >= ?", fromTime.Unix())
+ }
} else {
sess.And("issue.created_unix < ?", fromTime.Unix())
sess.And("issue.updated_unix >= ?", fromTime.Unix())