From 6958fefc27a3ba4df2888f4b38bad39448e97872 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 26 Jul 2022 09:34:59 +0800 Subject: [PATCH] * Finish task #61975. --- module/personnel/model.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/module/personnel/model.php b/module/personnel/model.php index a8dc6096fc..7868b43af9 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -479,17 +479,20 @@ class personnelModel extends model if($objectType == 'sprint') { $parentID = 0; - if($this->config->systemMode == 'new') $parentID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($objectID)->fetch('project'); + if($this->config->systemMode == 'new') + { + $this->loadModel('execution'); + $execution = $this->execution->getByID($objectID); + $parentID = $execution->project; + $project = $this->execution->getByID($parentID); + $objects = array($project->id => $project->name); + } - $objects = $this->dao->select('id,name')->from(TABLE_EXECUTION) - ->where('(project')->eq($parentID) - ->orWhere('id')->eq($parentID) - ->markRight(1) - ->andWhere('(id')->in($this->app->user->view->projects) - ->orWhere('id')->in($this->app->user->view->sprints) - ->markRight(1) + $objects += $this->dao->select('id,name')->from(TABLE_EXECUTION) + ->where('project')->eq($parentID) + ->andWhere('id')->in($this->app->user->view->sprints) ->andWhere('deleted')->eq(0) - ->orderBy('type_asc,openedDate_desc') + ->orderBy('openedDate_desc') ->limit('10') ->fetchPairs(); foreach($objects as $id => &$object)