From c9eb3ebfa122ff31b41603c6e273aa5801f6298f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Mon, 13 Sep 2021 11:14:54 +0800 Subject: [PATCH] * fix bug for finish task by repo. --- module/product/model.php | 3 ++- module/repo/model.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 8c58a3a463..9e4cb3ce60 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -371,7 +371,8 @@ class productModel extends model public function getProductIDByProject($projectID, $isFirst = true) { $products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT) - ->where('product')->in($this->app->user->view->products) + ->where('1=1') + ->beginIF(!$this->app->user->admin)->andWhere('product')->in($this->app->user->view->products)->fi() ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->fetchPairs(); diff --git a/module/repo/model.php b/module/repo/model.php index db67885e7c..b0f126b8bb 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -350,7 +350,7 @@ class repoModel extends model $scm = $repo->SCM == 'Subversion' ? 'svn' : 'git'; if($this->checkPriv($repo)) { - if($type == 'project' or $type == 'execution') + if(($type == 'project' or $type == 'execution') and $projectID) { foreach($productIdList as $productID) { @@ -1510,6 +1510,7 @@ class repoModel extends model elseif($taskAction == 'finish' and in_array($task->status, array('wait', 'pause', 'doing'))) { $this->post->set('finishedDate', date('Y-m-d')); + $this->post->set('realStarted', date('Y-m-d')); $this->post->set('currentConsumed', $this->post->consumed); $this->post->set('consumed', $this->post->consumed + $task->consumed); $changes = $this->task->finish($taskID);