diff --git a/framework/model.class.php b/framework/model.class.php index 3d0bed6bad..f1fc04fa1a 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -140,9 +140,12 @@ class model extends baseModel if(empty($method)) $method = $methodName; static $actions = array(); + static $hasAction = array(); + if(!isset($hasAction[$moduleName])) $hasAction[$moduleName] = true; + if($this->config->edition != 'open') { - if(empty($actions[$moduleName])) + if($hasAction[$moduleName] and empty($actions[$moduleName])) { $actions[$moduleName] = $this->dao->select('*')->from(TABLE_WORKFLOWACTION) ->where('module')->eq($moduleName) @@ -150,6 +153,8 @@ class model extends baseModel ->andWhere('status')->eq('enable') ->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi() ->fetchAll('action'); + + if(empty($actions[$moduleName])) $hasAction[$moduleName] = false; } } diff --git a/module/user/model.php b/module/user/model.php index fe78a52f5e..d34ec256eb 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -38,9 +38,9 @@ class userModel extends model * @access public * @return array */ - public function getList($params = 'nodeleted') + public function getList($params = 'nodeleted', $fields = '*') { - return $this->dao->select('*')->from(TABLE_USER) + return $this->dao->select($fields)->from(TABLE_USER) ->where('1 = 1') ->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq('inside')->fi() ->beginIF(strpos($params, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi() @@ -163,7 +163,7 @@ class userModel extends model public function getAvatarPairs($params = 'nodeleted') { $avatarPairs = array(); - $userList = $this->getList($params); + $userList = $this->getList($params, 'account,avatar'); foreach($userList as $user) $avatarPairs[$user->account] = $user->avatar; return $avatarPairs;