// small fix for some order by on listing

This commit is contained in:
Rémi Gaillard
2013-10-17 11:33:05 +02:00
parent f1ea9ba5b4
commit eb14e25e2a
+4 -2
View File
@@ -2189,8 +2189,10 @@ class AdminControllerCore extends Controller
if (preg_match('/[.!]/', $order_by))
{
$order_by_split = preg_split('/[.!]/', $order_by);
$order_by = pSQL($order_by_split[0]).'.`'.pSQL($order_by_split[1]).'`';
$order_by = bqSQL($order_by_split[0]).'.`'.bqSQL($order_by_split[1]).'`';
}
elseif ($order_by)
$order_by = '`'.bqSQL($order_by).'`';
$this->_orderWay = Tools::strtoupper($order_way);
@@ -2284,7 +2286,7 @@ class AdminControllerCore extends Controller
(isset($this->_filter) ? $this->_filter : '').$where_shop.'
'.(isset($this->_group) ? $this->_group.' ' : '').'
'.$having_clause.'
ORDER BY '.(($order_by == $this->identifier) ? 'a.' : '').'`'.pSQL($order_by).'` '.pSQL($order_way).
ORDER BY '.(($order_by == $this->identifier) ? 'a.' : '').$order_by.' '.pSQL($order_way).
($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : '').
(($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : '');