From 3d272e3d05ff765dce02799e596f468005f1cc90 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Fri, 23 Sep 2022 06:25:28 +0000 Subject: [PATCH 1/2] * Fix bug for hidden plan. --- module/story/control.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 67f2a48224..885587dc88 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1331,8 +1331,13 @@ class story extends control $this->view->hiddenURS = false; if(!empty($product->shadow)) { - $projectID = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('product')->eq($product->id)->fetch('project'); - $project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch(); + $projectID = $this->dao->select('t1.project')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t1.product')->eq($product->id) + ->andWhere('t2.type')->eq('project') + ->fetch('project'); + + $project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch(); if($project->model === 'waterfall') { From 71818667ab1d8675ce27c4a832c6af52dc498a89 Mon Sep 17 00:00:00 2001 From: liuruogu Date: Fri, 23 Sep 2022 06:30:19 +0000 Subject: [PATCH 2/2] * Fix bug for hidden plan. --- module/story/control.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 885587dc88..3c27e786e4 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1331,19 +1331,17 @@ class story extends control $this->view->hiddenURS = false; if(!empty($product->shadow)) { - $projectID = $this->dao->select('t1.project')->from(TABLE_PROJECTPRODUCT)->alias('t1') + $projectModel = $this->dao->select('t2.model')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq($product->id) ->andWhere('t2.type')->eq('project') - ->fetch('project'); + ->fetch('model'); - $project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch(); - - if($project->model === 'waterfall') + if($projectModel === 'waterfall') { $this->view->hiddenPlan = true; } - elseif($project->model === 'kanban') + elseif($projectModel === 'kanban') { $this->view->hiddenPlan = true; $this->view->hiddenURS = true;