From c87bc410188a64624fcea91a6eec3c7b65c46aba Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 9 Dec 2022 14:53:14 +0800 Subject: [PATCH] * Restore code. --- module/execution/model.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 38ec18c4bf..15be632a16 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1604,13 +1604,7 @@ class executionModel extends model ->page($pager) ->fetchAll('id'); - if(empty($productID) and !empty($executions)) - { - $projectProductList = $this->dao->select('t1.project, t1.product, t2.deleted')->from(TABLE_PROJECTPRODUCT)->alias('t1') - ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') - ->where('t1.project')->in(array_keys($executions)) - ->fetchAll('project'); - } + if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchPairs(); $hours = $this->loadModel('project')->computerProgress($executions); $burns = $this->getBurnData($executions); @@ -1674,11 +1668,9 @@ class executionModel extends model } /* Bind execution product */ - if(!empty($projectProductList) and !empty($projectProductList[$execution->id])) + if(!empty($projectProductIdList) and !empty($projectProductIdList[$execution->id])) { - $execution->product = $projectProductList[$execution->id]->product; - - if($projectProductList[$execution->id]->deleted) unset($executions[$key]); + $execution->product = $projectProductIdList[$execution->id]; } } return array_values($executions);