* [perf] Fix condition of mao.

This commit is contained in:
朱金勇
2024-11-20 15:42:49 +08:00
parent 10ceb0081b
commit 95ec5bc55f
2 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -226,7 +226,8 @@ class settingModel extends model
$params['section'] = isset($params['section']) ? $params['section'] : '';
$params['key'] = isset($params['key']) ? $params['key'] : '';
return $this->dao->$method('*')->from(TABLE_CONFIG)->where('1 = 1')
$access = $method == 'select' ? $this->mao : $this->dao;
return $access->$method('*')->from(TABLE_CONFIG)->where('1 = 1')
->beginIF($params['vision'])->andWhere('vision')->in($params['vision'])->fi()
->beginIF($params['owner'])->andWhere('owner')->in($params['owner'])->fi()
->beginIF($params['module'])->andWhere('module')->in($params['module'])->fi()
@@ -245,7 +246,7 @@ class settingModel extends model
public function getSysAndPersonalConfig(string $account = ''): array
{
$owner = 'system,' . ($account ? $account : '');
$records = $this->dao->select('*')->from(TABLE_CONFIG)
$records = $this->mao->select('*')->from(TABLE_CONFIG)
->where('owner')->in($owner)
->beginIF(!$this->app->upgrading)->andWhere('vision')->in(array('', $this->config->vision))->fi()
->orderBy('id')