From 81da6e5a202c62f9fcda1b8b463ae89c9c736858 Mon Sep 17 00:00:00 2001 From: shenshulong Date: Tue, 9 May 2023 08:45:04 +0000 Subject: [PATCH] * Adjusted programplan getPairs function. --- module/programplan/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/programplan/model.php b/module/programplan/model.php index 9db27beacf..c981eb7fc5 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -100,7 +100,8 @@ class programplanModel extends model } /** - * Get pairs. + * 获取项目中的阶段数据键值对。 + * Get stade pairs for project. * * @param int $executionID * @param int $productID @@ -108,7 +109,7 @@ class programplanModel extends model * @access public * @return array */ - public function getPairs($executionID, $productID = 0, $type = 'all') + public function getPairs(int $executionID, int $productID = 0, string $type = 'all'): array { $plans = $this->getStage($executionID, $productID, $type); @@ -124,12 +125,14 @@ class programplanModel extends model { if(strpos($type, 'leaf') !== false and isset($parents[$plan->id])) continue; - $paths = array_slice(explode(',', trim($plan->path, ',')), 1); + $paths = array_slice(explode(',', trim($plan->path, ',')), 1); $planName = ''; + foreach($paths as $path) { if(isset($plans[$path])) $planName .= '/' . $plans[$path]->name; } + $pairs[$planID] = $planName; }