* [perf] Fix condition of mao.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user