Merge pull request #12683 from snipe/fixes/additional_sort
Fixes/additional sort
This commit is contained in:
commit
d6434fa55a
1 changed files with 8 additions and 1 deletions
|
@ -192,7 +192,6 @@ class UsersController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
$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
|
// 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.
|
// case we override with the actual count, so we should return 0 items.
|
||||||
|
@ -218,6 +217,14 @@ class UsersController extends Controller
|
||||||
case 'company':
|
case 'company':
|
||||||
$users = $users->OrderCompany($order);
|
$users = $users->OrderCompany($order);
|
||||||
break;
|
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:
|
default:
|
||||||
$allowed_columns =
|
$allowed_columns =
|
||||||
[
|
[
|
||||||
|
|
Loading…
Add table
Reference in a new issue