* [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
This commit is contained in:
liugang
2025-08-21 08:38:53 +08:00
committed by tianshujie
parent 7ccc2890bd
commit 9d2f04c2ed
2 changed files with 2 additions and 4 deletions
+2 -1
View File
@@ -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]);
}
/**
-3
View File
@@ -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'];