From 537c4c86db2eebc8c8d41c0e7637a6809e9a551a Mon Sep 17 00:00:00 2001 From: Fabio Lovato Date: Thu, 8 Mar 2018 11:53:26 +0100 Subject: [PATCH] Non funzionavano gli ordinamenti per campi contenenti spazi --- ajax_dataload.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ajax_dataload.php b/ajax_dataload.php index f2bf1d05c..51c750501 100644 --- a/ajax_dataload.php +++ b/ajax_dataload.php @@ -79,8 +79,14 @@ if (!empty($module_query) && $module_query != 'menu' && $module_query != 'custom if ($cont > 1) { unset($pieces[$cont - 1]); } + + $order_by = $total['order_by'][$order['column']]; + + if( strstr( $order_by, ' ' ) ){ + $order_by = '`'.$order_by.'`'; + } - $module_query = implode('ORDER', $pieces).' ORDER BY '.$total['order_by'][$order['column']].' '.$order['dir']; + $module_query = implode('ORDER', $pieces).' ORDER BY '.$order_by.' '.$order['dir']; } // Calcolo di eventuali somme