Merge branch 'sql-optimization-zhangrunyu' into 'master'

SQL optimization

See merge request easycorp/zentaopms!924
This commit is contained in:
朱金勇
2021-12-20 00:47:21 +00:00
5 changed files with 49 additions and 49 deletions
+1 -1
View File
@@ -99,8 +99,8 @@ class userModel extends model
$users = $this->dao->select($fields)->from(TABLE_USER)
->where('1')
->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq($type)->fi()
->beginIF(strpos($params, 'nodeleted') !== false or empty($this->config->user->showDeleted))->andWhere('deleted')->eq('0')->fi()
->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq($type)->fi()
->beginIF($accounts)->andWhere('account')->in($accounts)->fi()
->orderBy($orderBy)
->beginIF($maxCount)->limit($maxCount)->fi()