diff options
author | 6543 <6543@obermui.de> | 2019-12-27 21:30:58 +0100 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-12-27 20:30:58 +0000 |
commit | f2d03cda96eb5febbf9801f6b6cf5daa37220bc9 (patch) | |
tree | 8906922ca58d47634ec2b6237f00a87389dd8316 /models/issue_milestone.go | |
parent | 0bcf644da4c3d21fad3ce8f33ccc26f8110568d6 (diff) | |
download | gitea-f2d03cda96eb5febbf9801f6b6cf5daa37220bc9.tar.gz gitea-f2d03cda96eb5febbf9801f6b6cf5daa37220bc9.zip |
[API] Extend times API (#9200)
Extensively extend the times API.
close #8833; close #8513; close #8559
Diffstat (limited to 'models/issue_milestone.go')
-rw-r--r-- | models/issue_milestone.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/issue_milestone.go b/models/issue_milestone.go index b7191f66ff..f33ad19ada 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -10,8 +10,8 @@ import ( "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/timeutil" - "xorm.io/builder" + "xorm.io/builder" "xorm.io/xorm" ) @@ -153,6 +153,7 @@ func (milestones MilestoneList) loadTotalTrackedTimes(e Engine) error { rows, err := e.Table("issue"). Join("INNER", "milestone", "issue.milestone_id = milestone.id"). Join("LEFT", "tracked_time", "tracked_time.issue_id = issue.id"). + Where("tracked_time.deleted = ?", false). Select("milestone_id, sum(time) as time"). In("milestone_id", milestones.getMilestoneIDs()). GroupBy("milestone_id"). @@ -187,6 +188,7 @@ func (m *Milestone) loadTotalTrackedTime(e Engine) error { has, err := e.Table("issue"). Join("INNER", "milestone", "issue.milestone_id = milestone.id"). Join("LEFT", "tracked_time", "tracked_time.issue_id = issue.id"). + Where("tracked_time.deleted = ?", false). Select("milestone_id, sum(time) as time"). Where("milestone_id = ?", m.ID). GroupBy("milestone_id"). |