diff --git a/framework/helper.class.php b/framework/helper.class.php index 02022d66c3..47c017dd43 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -637,6 +637,8 @@ function setParent(array $items) { foreach($items as $item) { + if(isset($item->isParent)) continue; + /* Set parent attribute. */ $item->isParent = false; if(isset($item->parent) && $item->parent == -1) diff --git a/module/execution/control.php b/module/execution/control.php index b5ceddf3ec..80c408d80b 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2597,6 +2597,7 @@ class execution extends control $projectPairs = array(); /* 项目ID为索引,项目名称为值的数组 [projectID => projectName]。 */ $orderedExecutions = array(); + $parentExecutions = array(); foreach($projects as $project) { $executions = zget($executionGroups, $project->id, array()); @@ -2606,6 +2607,7 @@ class execution extends control foreach($executions as $execution) { if($execution->grade == 1) $topExecutions[$execution->id] = $execution->id; + if($execution->grade > 1 && $execution->parent) $parentExecutions[$execution->parent] = $execution->parent; } /* 获取排序后的执行列表,并给每个执行设置团队信息。*/ @@ -2623,6 +2625,8 @@ class execution extends control $projectExecutions = array(); /* 项目对应的执行列表 [projectID => execution]。*/ foreach($orderedExecutions as $execution) { + if(isset($parentExecutions[$execution->id])) continue; + $execution->name = $executionNameList[$execution->id]; $projectExecutions[$execution->project][] = $execution; }