The fullname is displayed instead of the username if not empty

This commit is contained in:
Frédéric Guillot
2014-08-16 17:53:07 -07:00
parent db3c006be8
commit 658123a232
14 changed files with 48 additions and 22 deletions

View File

@@ -98,7 +98,17 @@ class User extends Base
*/
public function getList()
{
return $this->db->table(self::TABLE)->asc('username')->listing('id', 'username');
$users = $this->db->table(self::TABLE)->columns('id', 'username', 'name')->findAll();
$result = array();
foreach ($users as $user) {
$result[$user['id']] = $user['name'] ?: $user['username'];
}
asort($result);
return $result;
}
/**