Skip to content

Commit 115cbc6

Browse files
authored
ENGCOM-5052: Fixed Issue #22087 #22646
2 parents 8282f6b + fe72e19 commit 115cbc6

File tree

1 file changed

+9
-1
lines changed
  • app/code/Magento/Reports/Model/ResourceModel/Product/Sold

1 file changed

+9
-1
lines changed

app/code/Magento/Reports/Model/ResourceModel/Product/Sold/Collection.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
use Magento\Framework\DB\Select;
1515

1616
/**
17+
* Data collection.
18+
*
1719
* @SuppressWarnings(PHPMD.DepthOfInheritance)
1820
* @api
1921
* @since 100.0.2
2022
*/
2123
class Collection extends \Magento\Reports\Model\ResourceModel\Order\Collection
2224
{
2325
/**
24-
* Set Date range to collection
26+
* Set Date range to collection.
2527
*
2628
* @param int $from
2729
* @param int $to
@@ -79,6 +81,10 @@ public function addOrderedQty($from = '', $to = '')
7981
)->having(
8082
'order_items.qty_ordered > ?',
8183
0
84+
)->columns(
85+
'SUM(order_items.qty_ordered) as ordered_qty'
86+
)->group(
87+
'order_items.product_id'
8288
);
8389
return $this;
8490
}
@@ -116,6 +122,8 @@ public function setOrder($attribute, $dir = self::SORT_ORDER_DESC)
116122
}
117123

118124
/**
125+
* @inheritdoc
126+
*
119127
* @return Select
120128
* @since 100.2.0
121129
*/

0 commit comments

Comments
 (0)