* Finish task#50667,50675

This commit is contained in:
zenggang
2022-03-17 09:05:02 +00:00
parent b6db2c5c55
commit 414ec1b308
4 changed files with 17 additions and 15 deletions
+10 -2
View File
@@ -158,10 +158,11 @@ class userModel extends model
/**
* Get commiters from the user table.
*
* @param string $field
* @access public
* @return array
*/
public function getCommiters()
public function getCommiters($field = '')
{
$rawCommiters = $this->dao->select('commiter, account, realname')->from(TABLE_USER)->where('commiter')->ne('')->fetchAll();
if(!$rawCommiters) return array();
@@ -172,7 +173,14 @@ class userModel extends model
$userCommiters = explode(',', $commiter->commiter);
foreach($userCommiters as $userCommiter)
{
$commiters[$userCommiter] = $commiter->realname ? $commiter->realname : $commiter->account;
if($field)
{
$commiters[$userCommiter] = $commiter->$field;
}
else
{
$commiters[$userCommiter] = $commiter->realname ? $commiter->realname : $commiter->account;
}
}
}