Skip to content
Code-Schnipsel Gruppen Projekte
Commit 6c4b4282 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

fix: sorting

Übergeordneter 2e7b734f
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -49,14 +49,14 @@ function ($params) {
$sortOn = 'username';
$sortBy = 'ASC';
if (isset($params['sortOn'])) {
if (!empty($params['sortOn'])) {
$sortOn = $params['sortOn'];
}
if (isset($params['sortBy'])) {
if (!empty($params['sortBy'])) {
$sortBy = $params['sortBy'];
}
$Search->order($sortOn, $sortBy);
// exec
......
......@@ -19,7 +19,7 @@ class Search extends Singleton
/**
* @var string
*/
protected $order = 'id DESC';
protected $order = 'user_id DESC';
/**
* @var array
......@@ -538,7 +538,7 @@ protected function executeQueryParams($queryData = [])
return $Statement->fetchAll(\PDO::FETCH_ASSOC);
} catch (\Exception $Exception) {
QUI\System\Log::writeRecursive($Exception);
QUI\System\Log::writeException($Exception);
QUI\System\Log::writeRecursive($query);
QUI\System\Log::writeRecursive($binds);
throw new QUI\Exception('Something went wrong');
......@@ -554,8 +554,6 @@ protected function executeQueryParams($queryData = [])
*/
public function order(string $col, string $direction = 'ASC')
{
$allowed = [];
if (!\in_array($col, $this->getAllowedFields())) {
return;
}
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren