From ac415b67aab0d1eaad4310c2fe69a1bd8ca48db7 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 12 Oct 2021 11:05:23 +0800 Subject: [PATCH 1/2] * Finish task#43173. --- module/report/model.php | 10 ++++++---- module/report/view/projectdeviation.html.php | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/report/model.php b/module/report/model.php index 547c5d3a82..1fe35a26cc 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -98,8 +98,9 @@ class reportModel extends model */ public function getExecutions($begin = 0, $end = 0) { - $tasks = $this->dao->select('t1.*,t2.name as executionName')->from(TABLE_TASK)->alias('t1') + $tasks = $this->dao->select('t1.*,t2.name as executionName, t3.name as projectName')->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') + ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id') ->where('t1.status')->ne('cancel') ->andWhere('t1.deleted')->eq(0) ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() @@ -122,9 +123,10 @@ class reportModel extends model $executions[$executionID]->consumed = 0; } - $executions[$executionID]->name = $task->executionName; - $executions[$executionID]->estimate += $task->estimate; - $executions[$executionID]->consumed += $task->consumed; + $executions[$executionID]->projectName = $task->projectName; + $executions[$executionID]->name = $task->executionName; + $executions[$executionID]->estimate += $task->estimate; + $executions[$executionID]->consumed += $task->consumed; } return $executions; diff --git a/module/report/view/projectdeviation.html.php b/module/report/view/projectdeviation.html.php index b27aa2b4ea..54002b4f3a 100644 --- a/module/report/view/projectdeviation.html.php +++ b/module/report/view/projectdeviation.html.php @@ -45,6 +45,7 @@ report->id;?> + report->project;?> report->execution;?> report->estimate;?> report->consumed;?> @@ -56,6 +57,7 @@ $execution):?> + projectName;?> createLink('execution', 'view', "executionID=$id"), $execution->name);?> estimate;?> consumed;?> From 973ec92d4a5d43779e0bf297d2b8707abc526ff5 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 13 Oct 2021 08:36:23 +0800 Subject: [PATCH 2/2] * Add spaces. --- module/report/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/report/model.php b/module/report/model.php index 1fe35a26cc..8b01517ab1 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -98,7 +98,7 @@ class reportModel extends model */ public function getExecutions($begin = 0, $end = 0) { - $tasks = $this->dao->select('t1.*,t2.name as executionName, t3.name as projectName')->from(TABLE_TASK)->alias('t1') + $tasks = $this->dao->select('t1.*, t2.name as executionName, t3.name as projectName')->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id') ->where('t1.status')->ne('cancel')