From c53d900da43f2dbdaec43b3d923d2f67d8cb43ad Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 8 Jan 2024 14:26:49 +0800 Subject: [PATCH] * Get program list with hierarchy in screen's metric. --- module/metric/model.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/module/metric/model.php b/module/metric/model.php index 00147273ad..79c3771356 100755 --- a/module/metric/model.php +++ b/module/metric/model.php @@ -974,14 +974,15 @@ class metricModel extends model * Get object pairs by scope. * * @param string $scope - * @param bool $deptWithHierarchy + * @param bool $withHierarchy * @access public * @return array */ - public function getPairsByScope($scope, $deptWithHierarchy = false) + public function getPairsByScope($scope, $withHierarchy = false) { if(empty($scope) || $scope == 'system') return array(); - if($scope == 'dept' && $deptWithHierarchy) $scope = 'deptWithHierarchy'; + if($scope == 'dept' && $withHierarchy) $scope = 'deptWithHierarchy'; + if($scope == 'program' && $withHierarchy) $scope = 'programWithHierarchy'; $objectPairs = array(); switch($scope) @@ -1001,6 +1002,9 @@ class metricModel extends model ->andWhere('type')->eq('program') ->fetchPairs(); break; + case 'programWithHierarchy': + $objectPairs = $this->loadModel('program')->getParentPairs(); + break; case 'product': $objectPairs = $this->dao->select('id, name')->from(TABLE_PRODUCT) ->where('deleted')->eq(0)->fetchPairs();