From 17bbda6505604d0e5ec3e465b1ce0c1e91c7fc27 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 10 Feb 2023 06:09:44 +0000 Subject: [PATCH] * Format the code. --- module/programplan/model.php | 6 +++++- module/user/model.php | 8 -------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/module/programplan/model.php b/module/programplan/model.php index e9287a1cc6..777f1afad4 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -1118,7 +1118,11 @@ class programplanModel extends model if(dao::isError()) return false; $this->setTreePath($planID); - if($plan->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprint'); + if($plan->acl != 'open') + { + $planIdList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('path')->like("%,$planID,%")->andWhere('type')->eq('stage')->fetchAll('id'); + $this->loadModel('user')->updateUserView(array_keys($planIdList), 'sprint'); + } if($planChanged) { diff --git a/module/user/model.php b/module/user/model.php index ff2aa02a62..eea5c31733 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2417,14 +2417,6 @@ class userModel extends model $parentIdList = array(); foreach($sprints as $sprint) $parentIdList[$sprint->project] = $sprint->project; - $childList = array(); - foreach($sprints as $sprint) - { - $children = $this->dao->select('id, project, PM, PO, QD, RD, openedBy, acl, parent, path, grade, type')->from(TABLE_EXECUTION)->where('path')->like("%,$sprint->id,%")->fetchAll('id'); - $childList = $childList + $children; - } - $sprints = $sprints + $childList; - /* Get team group. */ $teamGroups = array(); $stmt = $this->dao->select('root,account')->from(TABLE_TEAM)