diff options
Diffstat (limited to 'app/Model/Project.php')
-rw-r--r-- | app/Model/Project.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/Model/Project.php b/app/Model/Project.php index 9f53fdda..9ee54cbd 100644 --- a/app/Model/Project.php +++ b/app/Model/Project.php @@ -80,12 +80,23 @@ class Project extends Base */ public function getAllowedUsers($project_id) { - return $this->db + $users = $this->db ->table(self::TABLE_USERS) ->join(User::TABLE, 'id', 'user_id') ->eq('project_id', $project_id) ->asc('username') - ->listing('user_id', 'username'); + ->columns(User::TABLE.'.id', User::TABLE.'.username', User::TABLE.'.name') + ->findAll(); + + $result = array(); + + foreach ($users as $user) { + $result[$user['id']] = $user['name'] ?: $user['username']; + } + + asort($result); + + return $result; } /** |