From 203f0984d94b211fc2b7c729961afd32a61ac150 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 29 Jun 2021 08:57:48 +0800 Subject: [PATCH] * Adjust execution link plan. --- module/execution/control.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 31e2bab05c..cff10513b6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1404,9 +1404,10 @@ class execution extends control } /* Link the plan stories. */ - $diffResult = array_diff($oldPlans, $_POST['plans']); - $diffResult = array_merge($diffResult, array_diff($_POST['plans'], $oldPlans)); - if(current($_POST['plans']) and !empty($diffResult)) + $newPlans = $this->dao->select('plan')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($executionID)->andWhere('plan')->ne(0)->fetchPairs('plan'); + $diffResult = array_diff($oldPlans, $newPlans); + $diffResult = array_merge($diffResult, array_diff($newPlans, $oldPlans)); + if(!empty($newPlans) and !empty($diffResult)) { $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project'); $this->loadModel('productplan')->linkProject($executionID, $_POST['plans'], $oldPlanStories);