* Finish task#50667,50675
This commit is contained in:
+10
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user