Voicemails - List: Implement natural sorting of Voicemail ID column.

This commit is contained in:
fusionate 2023-10-19 18:54:30 +00:00
parent c6a924f492
commit 1b2bcf2719
No known key found for this signature in database
1 changed files with 4 additions and 3 deletions

View File

@ -90,8 +90,9 @@
} }
//get order and order by //get order and order by
$order_by = $_GET["order_by"] ?? ''; $order_by = $_GET["order_by"] ?? 'voicemail_id';
$order = $_GET["order"] ?? ''; $order = $_GET["order"] ?? 'asc';
$sort = $order_by == 'voicemail_id' ? 'natural' : null;
//set additional variables //set additional variables
$show = $_GET["show"] ?? ''; $show = $_GET["show"] ?? '';
@ -152,7 +153,7 @@
//get the list //get the list
$sql = str_replace('count(voicemail_uuid)', '*', $sql); $sql = str_replace('count(voicemail_uuid)', '*', $sql);
$sql .= order_by($order_by, $order, 'voicemail_id', 'asc'); $sql .= order_by($order_by, $order, null, null, $sort);
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database; $database = new database;
$voicemails = $database->select($sql, $parameters ?? null, 'all'); $voicemails = $database->select($sql, $parameters ?? null, 'all');