From 9d2f04c2ed956bbb1be19829fc6c2ae040689502 Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 11 Aug 2025 14:53:00 +0800 Subject: [PATCH] * [perf] refactor: optimize search parameter handling mechanism - Replace loadModel('search')->setSearchParams() call with direct session setting in framework/model.class.php - Remove redundant parameter clearing and early return logic from searchModel::setSearchParams method --- framework/model.class.php | 3 ++- module/search/model.php | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/framework/model.class.php b/framework/model.class.php index 0ed7134191..39e9cafd96 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -314,7 +314,8 @@ class model extends baseModel } $key++; } - $this->loadModel('search')->setSearchParams(['module' => $module, 'funcModel' => $funcModel, 'funcName' => $methodName, 'funcArgs' => $funcArgs]); + + $this->session->set($module . 'searchParams', ['funcModel' => $funcModel, 'funcName' => $methodName, 'funcArgs' => $funcArgs]); } /** diff --git a/module/search/model.php b/module/search/model.php index 07375c4724..5d40873849 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -26,9 +26,6 @@ class searchModel extends model { $module = $searchConfig['module']; - $this->session->set($module . 'searchParams', null); // 清除旧的搜索参数。Clear old search params. - if(!empty($searchConfig['funcModel']) && !empty($searchConfig['funcName'])) return $this->session->set($module . 'searchParams', $searchConfig); - if($this->config->edition != 'open') $searchConfig = $this->searchTao->processBuildinFields($module, $searchConfig); $searchParams['module'] = $searchConfig['module'];