Merge branch 'ticket-invoiceOrderBy' into develop

This commit is contained in:
Marion Muszynski 2016-07-11 16:13:49 +02:00
commit 9284fe3daa

View File

@ -872,6 +872,9 @@ class Sale {
') as $row) {
if(!isset($_orders[(int)$row['id_order']])) {
$_orders[(int)$row['id_order']] = array();
$_nb_product[(int)$row['id_order']] = 1;
} else {
$_nb_product[(int)$row['id_order']]++;
}
if(!isset($_orders[(int)$row['id_order']][$row['id_sale']]) ) {
$_orders[(int)$row['id_order']][$row['id_sale']] = 1;
@ -933,12 +936,12 @@ class Sale {
} else {
// tri par date pour les M2+
// sort($order_print);
/*usort($order_print, function ($a, $b) {
if ($order_sales[$a] == $order_sales[$b]) {
usort($order_print, function ($a, $b) {
if ($_nb_product[$a] == $_nb_product[$b]) {
return 0;
}
return ($order_sales[$a] < $order_sales[$b]) ? -1 : 1;
});*/
return ($_nb_product[$a] < $_nb_product[$b]) ? -1 : 1;
});
return $order_print;
}