From e77db07eb2c4bcde646bbd8f8cce94de5e62bee8 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 27 Nov 2023 06:01:26 +0000 Subject: [PATCH] * Refactor getListCount function. --- module/search/model.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/search/model.php b/module/search/model.php index 3140047fd9..30a5cf4a5c 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -465,24 +465,24 @@ class searchModel extends model } /** + * 获取可访问的有索引的模块。 * Get counts of keyword search results. * - * @param string $keywords - * @param string $type + * @param string|array $type * @access public * @return array */ - public function getListCount(array|string $type = 'all') + public function getListCount(array|string $type = 'all'): array { $allowedObjects = $this->searchTao->getAllowedObjects($type); - $filterObject = array(); + $filterObjects = array(); foreach($allowedObjects as $index => $object) { if(strpos(',feedback,ticket,', ",$object,") !== false) { unset($allowedObjects[$index]); - $filterObject[] = $object; + $filterObjects[] = $object; } } @@ -494,7 +494,7 @@ class searchModel extends model ->markRight(2) ->andWhere('addedDate')->le(helper::now()) ->groupBy('objectType') - ->fetchPairs('objectType', 'objectCount'); + ->fetchPairs(); arsort($typeCount); return $typeCount; }