mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Merge pull request #12683 from snipe/fixes/additional_sort
Fixes/additional sort
This commit is contained in:
commit
d6434fa55a
|
@ -192,7 +192,6 @@ class UsersController extends Controller
|
|||
}
|
||||
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
$offset = (($users) && (request('offset') > $users->count())) ? 0 : request('offset', 0);
|
||||
|
||||
// Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
|
||||
// case we override with the actual count, so we should return 0 items.
|
||||
|
@ -218,6 +217,14 @@ class UsersController extends Controller
|
|||
case 'company':
|
||||
$users = $users->OrderCompany($order);
|
||||
break;
|
||||
case 'first_name':
|
||||
$users->orderBy('first_name', $order);
|
||||
$users->orderBy('last_name', $order);
|
||||
break;
|
||||
case 'last_name':
|
||||
$users->orderBy('last_name', $order);
|
||||
$users->orderBy('first_name', $order);
|
||||
break;
|
||||
default:
|
||||
$allowed_columns =
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue