* Resume getProjectTeamMemberPairs of program.

This commit is contained in:
zhujinyong
2021-03-04 13:47:43 +08:00
parent 8ddc85997e
commit b30d6a3d67
2 changed files with 30 additions and 0 deletions
View File
+30
View File
@@ -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;
}
}