From 7001f6c2d5ff7db21a0701c8e81b45ebb5517384 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 25 Jan 2022 11:16:14 +0800 Subject: [PATCH] * Fix bug #18838. --- module/execution/control.php | 2 +- module/execution/model.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index b24061684b..03de9d0d5d 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2043,7 +2043,7 @@ class execution extends control if($branches) $branchID = key($branches); } - $plans = $this->execution->getPlans($products); + $plans = $this->execution->getPlans($products, 'skipParent', $executionID); $allPlans = array('' => ''); if(!empty($plans)) { diff --git a/module/execution/model.php b/module/execution/model.php index ed5524dcc2..9ca59927f6 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3735,15 +3735,16 @@ class executionModel extends model * * @param int|array $productID * @param string $param withMainPlan|skipParent + * @param int $executionID * @return mixed */ - public function getPlans($products, $param = '') + public function getPlans($products, $param = '', $executionID = 0) { $this->loadModel('productplan'); $param = strtolower($param); $branchIDList = strpos($param, 'withmainplan') !== false ? array(BRANCH_MAIN => BRANCH_MAIN) : array(); - $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed'); + $branchGroups = $this->getBranchByProduct(array_keys($products), $executionID, 'noclosed'); foreach($branchGroups as $branches) { foreach($branches as $branchID => $branchName) $branchIDList[$branchID] = $branchID;