From 9dd56671180d4eca5c13aa3d72dc03e140c345fc Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 29 Apr 2016 09:49:04 -0600 Subject: [PATCH] Change voicemail_id from text to numeric and remove the cast on voicemail_id. --- app/voicemails/app_config.php | 2 +- app/voicemails/voicemails.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/voicemails/app_config.php b/app/voicemails/app_config.php index d894dcbdfb..e718141f9b 100644 --- a/app/voicemails/app_config.php +++ b/app/voicemails/app_config.php @@ -84,7 +84,7 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary"; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_id"; - $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the voicemail id."; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "voicemail_password"; diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index 0eaec3213a..2383c31834 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -116,10 +116,10 @@ else { //get the list $sql = str_replace('count(*) as num_rows', '*', $sql); if (strlen($order_by) > 0) { - $sql .= ($order_by == 'voicemail_id') ? "order by cast(voicemail_id as int) ".$order." " : "order by ".$order_by." ".$order." "; + $sql .= ($order_by == 'voicemail_id') ? "order by voicemail_id ".$order." " : "order by ".$order_by." ".$order." "; } else { - $sql .= "order by cast(voicemail_id as int) asc "; + $sql .= "order by voicemail_id asc "; } $sql .= "limit ".$rows_per_page." offset ".$offset." "; $prep_statement = $db->prepare(check_sql($sql));