From 2d596a6e19f3dfeb091b8189d9b60551c4fe0d8c Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 31 Oct 2024 17:07:17 +0800 Subject: [PATCH] * [refac] revert code of calling mao to access cache. --- module/product/zen.php | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/module/product/zen.php b/module/product/zen.php index 561a0a2b98..57d4987020 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -864,26 +864,14 @@ class productZen extends product $project = $projectID ? $this->loadModel('project')->getByID($projectID) : null; if(!empty($projectID) && !empty($project->hasProduct) && $this->app->rawModule == 'projectstory') { - $moduleTree = $this->app->mao->label('projectModuleTree')->getByKey('CACHE_MODULE_TREE', 'project', $projectID, $storyType); - if(!$moduleTree) - { - $moduleTree = $this->tree->getProjectStoryTreeMenu($projectID, 0, array('treeModel', $createModuleLink), array('storyType' => $storyType)); - $this->app->mao->setByLabel($moduleTree, 'projectModuleTree'); - } - return $moduleTree; + return $this->tree->getProjectStoryTreeMenu($projectID, 0, array('treeModel', $createModuleLink), array('storyType' => $storyType)); } /* Pre generate parameters. */ $userFunc = array('treeModel', $createModuleLink); $extra = array('projectID' => $projectID, 'productID' => $productID); - $moduleTree = $this->app->mao->label('productModuleTree')->getByKey('CACHE_MODULE_TREE', 'product', $productID, $branch, $storyType, $param); - if(!$moduleTree) - { - $moduleTree = $this->tree->getTreeMenu($productID, 'story', 0, $userFunc, $extra, $branch, "¶m=$param&storyType=$storyType"); - $this->app->mao->setByLabel($moduleTree, 'productModuleTree'); - } - return $moduleTree; + return $this->tree->getTreeMenu($productID, 'story', 0, $userFunc, $extra, $branch, "¶m=$param&storyType=$storyType"); } /** @@ -1452,20 +1440,10 @@ class productZen extends product $module = $this->app->tab == 'product' ? $storyType : $this->app->tab; $this->view->showGrades = !empty($this->config->{$module}->showGrades) ? $this->config->{$module}->showGrades : $this->story->getDefaultShowGrades($this->view->gradeMenu); - $users = $this->app->mao->getByKey('CACHE_USER_PAIRS'); - if($users) - { - $users = (array)$users; - } - else - { - $users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted'); - $this->app->mao->setByKey($users); - } $storyType = $isProjectStory ? 'all' : $storyType; $this->view->summary = $this->product->summary($stories, $storyType); $this->view->plans = $this->loadModel('productplan')->getPairs($productID, isset($projectProducts[$productID]) ? array(BRANCH_MAIN) + $projectProducts[$productID]->branches : (($branch === 'all' || empty($branch)) ? '' : $branch), 'unexpired,noclosed', true); - $this->view->users = $users; + $this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted'); $this->view->modules = $this->loadModel('tree')->getOptionMenu($productID, 'story', 0, $branchID); $this->view->storyTasks = $this->loadModel('task')->getStoryTaskCounts($storyIdList); $this->view->storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList);