* Improve project list.
This commit is contained in:
@@ -97,10 +97,12 @@ class model extends baseModel
|
||||
if(empty($module)) $module = $moduleName;
|
||||
if(empty($method)) $method = $methodName;
|
||||
|
||||
static $actions = array();
|
||||
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)
|
||||
@@ -108,6 +110,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,12 +35,13 @@ class userModel extends model
|
||||
* Get inside users list of current company.
|
||||
*
|
||||
* @param string $params
|
||||
* @param string $fields
|
||||
* @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()
|
||||
@@ -158,7 +159,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;
|
||||
|
||||
Reference in New Issue
Block a user