From 59efd44767e0d56665c7f79d5f2613fa494fa0d6 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Sat, 2 Apr 2022 14:03:23 +0800 Subject: [PATCH] * Adjust codes. --- module/story/control.php | 12 ++++++------ module/story/model.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index d82522d498..53dbb9271a 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -2332,21 +2332,21 @@ class story extends control /* Get users, products and relations. */ $users = $this->loadModel('user')->getPairs('noletter'); $products = $this->product->getPairs('nocode'); - $relations = $this->story->getStoryRelationByIDs($storyIdList, $type); + $relations = $this->story->getStoryRelationByIds($storyIdList, $type); /* Get related objects id lists. */ $relatedProductIdList = array(); $relatedStoryIdList = array(); $relatedPlanIdList = array(); $relatedBranchIdList = array(); - $relatedStoryIDs = array(); + $relatedStoryIds = array(); foreach($stories as $story) { $relatedProductIdList[$story->product] = $story->product; $relatedPlanIdList[$story->plan] = $story->plan; $relatedBranchIdList[$story->branch] = $story->branch; - $relatedStoryIDs[$story->id] = $story->id; + $relatedStoryIds[$story->id] = $story->id; if(isset($relations[$story->id])) $story->linkStories = $story->linkStories . ',' . $relations[$story->id]; @@ -2359,9 +2359,9 @@ class story extends control } } - $storyTasks = $this->loadModel('task')->getStoryTaskCounts($relatedStoryIDs); - $storyBugs = $this->loadModel('bug')->getStoryBugCounts($relatedStoryIDs); - $storyCases = $this->loadModel('testcase')->getStoryCaseCounts($relatedStoryIDs); + $storyTasks = $this->loadModel('task')->getStoryTaskCounts($relatedStoryIds); + $storyBugs = $this->loadModel('bug')->getStoryBugCounts($relatedStoryIds); + $storyCases = $this->loadModel('testcase')->getStoryCaseCounts($relatedStoryIds); /* Get related objects title or names. */ $productsType = $this->dao->select('id, type')->from(TABLE_PRODUCT)->where('id')->in($relatedProductIdList)->fetchPairs(); diff --git a/module/story/model.php b/module/story/model.php index b1733f8b60..51f2db0d23 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4389,14 +4389,14 @@ class storyModel extends model } /** - * Get story relation by IDs. + * Get story relation by Ids. * * @param array $storyIdList * @param string $storyType * @access public * @return array */ - public function getStoryRelationByIDs($storyIdList, $storyType) + public function getStoryRelationByIds($storyIdList, $storyType) { $conditionField = $storyType == 'story' ? 'BID' : 'AID'; $storyType = $storyType == 'story' ? 'BID, GROUP_CONCAT(`AID` SEPARATOR ",")' : 'AID, GROUP_CONCAT(`BID` SEPARATOR ",")';