From 64292d57117e321957b5ea86e7ffcaf781b19ead Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 7 Feb 2023 14:09:55 +0800 Subject: [PATCH] * Finish task #83953. --- module/repo/model.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/module/repo/model.php b/module/repo/model.php index 29e3b8e167..d7f440f85a 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -2203,7 +2203,18 @@ class repoModel extends model { $pairs = array(); $executions = $this->loadModel('execution')->getList(0, 'all', 'undone', 0, $product, $branch); - foreach($executions as $execution) $pairs[$execution->id] = $execution->name; + $parents = $this->dao->select('distinct parent,parent')->from(TABLE_EXECUTION)->where('type')->eq('stage')->andWhere('grade')->gt(1)->andWhere('deleted')->eq(0)->fetchPairs(); + foreach($executions as $execution) + { + if(!empty($parents[$execution->id])) continue; + + if($execution->type == 'stage' and $execution->grade > 1) + { + $parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($execution->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs(); + $execution->name = implode('/', $parentExecutions); + } + $pairs[$execution->id] = $execution->name; + } return $pairs; }