mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #2099 from dmeltzer/sqlite-fixes
Fix a regression in Helper::usersList and ::managerList()
This commit is contained in:
commit
0a2fb2ace7
|
@ -164,10 +164,11 @@ class Helper
|
|||
|
||||
public static function managerList()
|
||||
{
|
||||
$manager_list = User::where('deleted_at', '=', null)
|
||||
->orderBy('last_name', 'asc')
|
||||
->orderBy('first_name', 'asc')->get()
|
||||
->lists('full_name', 'id');
|
||||
$manager_list = array('' => '') +
|
||||
User::where('deleted_at', '=', null)
|
||||
->orderBy('last_name', 'asc')
|
||||
->orderBy('first_name', 'asc')->get()
|
||||
->lists('complete_name', 'id')->toArray();
|
||||
|
||||
return $manager_list;
|
||||
}
|
||||
|
@ -187,12 +188,13 @@ class Helper
|
|||
|
||||
public static function usersList()
|
||||
{
|
||||
$users_list = User::where('deleted_at', '=', null)
|
||||
->where('show_in_list','=',1)
|
||||
->orderBy('last_name', 'asc')
|
||||
->orderBy('first_name', 'asc')->get()
|
||||
->lists('full_name', 'id');
|
||||
|
||||
$users_list = array( '' => trans('general.select_user')) +
|
||||
User::where('deleted_at', '=', null)
|
||||
->where('show_in_list','=',1)
|
||||
->orderBy('last_name', 'asc')
|
||||
->orderBy('first_name', 'asc')->get()
|
||||
->lists('complete_name', 'id')->toArray();
|
||||
|
||||
return $users_list;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,6 +123,11 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
return $this->first_name . " " . $this->last_name;
|
||||
}
|
||||
|
||||
public function getCompleteNameAttribute()
|
||||
{
|
||||
return $this->last_name . ", " . $this->first_name . " (" . $this->username . ")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user Gravatar image url.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue