* Improve project list.

This commit is contained in:
songchenxuan
2023-06-27 14:32:07 +08:00
parent 3d7c6fbd1e
commit dc31210bfb
2 changed files with 10 additions and 5 deletions
+4 -3
View File
@@ -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;