* Resume getProjectTeamMemberPairs of program.
This commit is contained in:
@@ -875,4 +875,34 @@ class programModel extends model
|
||||
}
|
||||
return $stats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project team member pairs.
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectTeamMemberPairs($programID = 0)
|
||||
{
|
||||
$projectList = $this->getPRJPairs($programID);
|
||||
if(!$projectList) return array('' => '');
|
||||
|
||||
$users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account')
|
||||
->where('t1.root')->in(array_keys($projectList))
|
||||
->andWhere('t1.type')->eq('project')
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->fetchAll('account');
|
||||
if(!$users) return array('' => '');
|
||||
|
||||
foreach($users as $account => $user)
|
||||
{
|
||||
$firstLetter = ucfirst(substr($user->account, 0, 1)) . ':';
|
||||
if(!empty($this->config->isINT)) $firstLetter = '';
|
||||
$users[$account] = $firstLetter . ($user->realname ? $user->realname : $user->account);
|
||||
}
|
||||
|
||||
return array('' => '') + $users;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user