diff options
author | Lauris BH <lauris@nix.lv> | 2018-02-19 04:39:26 +0200 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2018-02-19 10:39:26 +0800 |
commit | 58893384e848b54687c21d6d2ca38b70b3036ae2 (patch) | |
tree | 343c231b40e378ccd089fc7796401f1459fdc1a2 /models/repo_activity.go | |
parent | fb2c176491ebc0f18e6ef25038ca84db561539e2 (diff) | |
download | gitea-58893384e848b54687c21d6d2ca38b70b3036ae2.tar.gz gitea-58893384e848b54687c21d6d2ca38b70b3036ae2.zip |
Add issue closed time column to fix activity closed issues list (#3537)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
Diffstat (limited to 'models/repo_activity.go')
-rw-r--r-- | models/repo_activity.go | 8 |
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()) |