Include depts in returned list, sort by dept

This commit is contained in:
snipe 2017-05-23 02:46:55 -07:00
parent cefb20d46f
commit 811ddd2f67

View file

@ -38,8 +38,9 @@ class UsersController extends Controller
'users.company_id', 'users.company_id',
'users.last_login', 'users.last_login',
'users.deleted_at', 'users.deleted_at',
'users.department_id',
'users.activated' 'users.activated'
])->with('manager', 'groups', 'userloc', 'company', 'throttle','assets','licenses','accessories','consumables') ])->with('manager', 'groups', 'userloc', 'company', 'department','throttle','assets','licenses','accessories','consumables')
->withCount('assets','licenses','accessories','consumables'); ->withCount('assets','licenses','accessories','consumables');
$users = Company::scopeCompanyables($users); $users = Company::scopeCompanyables($users);
@ -67,6 +68,9 @@ class UsersController extends Controller
case 'location': case 'location':
$users = $users->OrderLocation($order); $users = $users->OrderLocation($order);
break; break;
case 'department':
$users = $users->OrderDepartment($order);
break;
default: default:
$allowed_columns = $allowed_columns =
[ [