Fix category sorting

This commit is contained in:
Nathan Gray 2016-03-24 17:47:55 +00:00
parent cd8632e354
commit 633a1b1dec

View File

@ -295,9 +295,9 @@ class Categories
{ {
if (in_array($order, array('name','description','appname','app_name'))) if (in_array($order, array('name','description','appname','app_name')))
{ {
return $sign * strcasecmp($a['$order'], $b['$order']); return $sign * strcasecmp($a[$order], $b[$order]);
} }
return $sign*(int)$a['$order'] - $sign*(int)$b['$order']; return $sign*(int)$a[$order] - $sign*(int)$b[$order];
}); });
} }
// limit the number of returned rows // limit the number of returned rows
@ -339,7 +339,7 @@ class Categories
if (!$sort) $sort = 'ASC'; if (!$sort) $sort = 'ASC';
if (!$order) $order = 'cat_name'; if (!$order) $order = 'cat_name';
//error_log(__METHOD__."($start,$limit,$query,$sort,$order,globals=$globals,parent=$parent_id,$unserialize_data) account_id=$this->account_id, appname=$this->app_name: ".function_backtrace()); error_log(__METHOD__."($start,$limit,$query,$sort,$order,globals=$globals,parent=$parent_id,$unserialize_data) account_id=$this->account_id, appname=$this->app_name: ".function_backtrace());
$parents = $cats = array(); $parents = $cats = array();