Skip to content

Instantly share code, notes, and snippets.

@edavydova
Created March 31, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edavydova/3447e38c095121accbd143f6c9210815 to your computer and use it in GitHub Desktop.
Save edavydova/3447e38c095121accbd143f6c9210815 to your computer and use it in GitHub Desktop.
diff --git a/app/functions/fn.users.php b/app/functions/fn.users.php
index 5790c3f749..0b1ee5151e 100644
--- a/app/functions/fn.users.php
+++ b/app/functions/fn.users.php
@@ -1259,16 +1259,17 @@ function fn_get_users($params, &$auth, $items_per_page = 0, $custom_view = '')
];
// Define sort fields
- $sortings = array(
- 'id' => '?:users.user_id',
- 'username' => '?:users.user_login',
- 'email' => '?:users.email',
- 'name' => array('?:users.firstname', '?:users.lastname'),
- 'date' => '?:users.timestamp',
- 'type' => '?:users.user_type',
- 'status' => '?:users.status',
- 'phone' => '?:users.phone',
- );
+ $sortings = [
+ 'id' => '?:users.user_id',
+ 'username' => '?:users.user_login',
+ 'email' => '?:users.email',
+ 'name' => ['?:users.firstname', '?:users.lastname'],
+ 'date' => '?:users.timestamp',
+ 'type' => '?:users.user_type',
+ 'status' => '?:users.status',
+ 'phone' => '?:users.phone',
+ 'last_login' => '?:users.last_login'
+ ];
if ($params['extended_search']) {
$fields['company_name'] = '?:companies.company as company_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment