Skip to content

Commit

Permalink
Pack tracking: fix displaying extra lines
Browse files Browse the repository at this point in the history
  • Loading branch information
getdatakick committed Nov 7, 2022
1 parent b03eaa1 commit 32637b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stats/statsproduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private function getSales($productId)
->where('o.valid ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o'));

if ($this->packTracking) {
$sql->leftJoin('order_detail_pack', 'p', 'p.id_order_detail = od.id_order_detail');
$sql->leftJoin('order_detail_pack', 'p', "(p.id_order_detail = od.id_order_detail AND p.id_product = $productId)");
$sql->select('IFNULL(p.quantity, 0) AS pack_quantity');
$sql->where("(od.product_id = $productId OR p.id_product = $productId)");
} else {
Expand Down

0 comments on commit 32637b7

Please sign in to comment.