From 1849f501fbb4748c80d0cd83d55e2214e5ff3427 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 20 Feb 2023 02:11:04 +0000 Subject: [PATCH] * Sort the IDs, the child stage comes first, and the parent stage follows. --- module/execution/control.php | 2 -- module/execution/model.php | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index a4f57b86d6..d47b66eaa6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2222,8 +2222,6 @@ class execution extends control { $executionIdList = $this->post->executionIDList; if(is_string($executionIdList)) $executionIdList = explode(',', $executionIdList); - /* Sub-phases are changed first and then parented. */ - rsort($executionIdList); $pointOutStages = $this->execution->batchChangeStatus($executionIdList, $status); $project = $this->loadModel('project')->getById($projectID); diff --git a/module/execution/model.php b/module/execution/model.php index f31635836e..be0a83044d 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -985,6 +985,9 @@ class executionModel extends model $this->loadModel('programplan'); $this->loadModel('action'); + /* Sort the IDs, the child stage comes first, and the parent stage follows. */ + $executionIdList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->orderBy('grade_desc')->fetchPairs(); + $pointOutStages = ''; foreach($executionIdList as $executionID) {