Skip to content
Snippets Groups Projects
Verified Commit a5c7fcae authored by Damien's avatar Damien
Browse files

FEAT #12635 TIME 0:10 Add id for order by

parent 88517152
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,6 @@ use Contact\models\ContactCustomFieldListModel; ...@@ -17,7 +17,6 @@ use Contact\models\ContactCustomFieldListModel;
use Contact\models\ContactFillingModel; use Contact\models\ContactFillingModel;
use Contact\models\ContactModel; use Contact\models\ContactModel;
use Contact\models\ContactParameterModel; use Contact\models\ContactParameterModel;
use CustomField\models\CustomFieldModel;
use Entity\models\EntityModel; use Entity\models\EntityModel;
use Group\controllers\PrivilegeController; use Group\controllers\PrivilegeController;
use History\controllers\HistoryController; use History\controllers\HistoryController;
...@@ -66,7 +65,7 @@ class ContactController ...@@ -66,7 +65,7 @@ class ContactController
$queryParams['offset'] = (empty($queryParams['offset']) || !is_numeric($queryParams['offset']) ? 0 : (int)$queryParams['offset']); $queryParams['offset'] = (empty($queryParams['offset']) || !is_numeric($queryParams['offset']) ? 0 : (int)$queryParams['offset']);
$queryParams['limit'] = (empty($queryParams['limit']) || !is_numeric($queryParams['limit']) ? 25 : (int)$queryParams['limit']); $queryParams['limit'] = (empty($queryParams['limit']) || !is_numeric($queryParams['limit']) ? 25 : (int)$queryParams['limit']);
$order = !in_array($queryParams['order'], ['asc', 'desc']) ? '' : $queryParams['order']; $order = !in_array($queryParams['order'], ['asc', 'desc']) ? '' : $queryParams['order'];
$queryParams['orderBy'] = !in_array($queryParams['orderBy'], ['firstname', 'lastname', 'company']) ? null : ["{$queryParams['orderBy']} {$order}"]; $queryParams['orderBy'] = !in_array($queryParams['orderBy'], ['firstname', 'lastname', 'company']) ? ['id'] : ["{$queryParams['orderBy']} {$order}", 'id'];
if (!empty($queryParams['search'])) { if (!empty($queryParams['search'])) {
$fields = ['firstname', 'lastname', 'company', 'address_number', 'address_street', 'address_additional1', 'address_additional2', 'address_postcode', 'address_town', 'address_country']; $fields = ['firstname', 'lastname', 'company', 'address_number', 'address_street', 'address_additional1', 'address_additional2', 'address_postcode', 'address_town', 'address_country'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment