Skip to content

Commit 15c341a

Browse files
committed
ACP2E-3189: fix integration test failure
1 parent 0faff3c commit 15c341a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/Magento/Sales/Model/ResourceModel/Report/Bestsellers.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ private function processStoreAggregate(?int $storeId, $from = null, $to = null):
277277
);
278278

279279
$subSelect = $this->getRangeSubSelect($from, $to);
280-
$dataRange = $this->getRange($subSelect);
281-
282-
$whereCondition = $connection->prepareSqlCondition($periodExpr, ['in' => $dataRange]);
280+
if ($subSelect) {
281+
$dataRange = $this->getRange($subSelect);
282+
$whereCondition = $connection->prepareSqlCondition($periodExpr, ['in' => $dataRange]);
283+
}
283284

284285
$select = $connection->select();
285286
$select->group([$periodExpr, 'source_table.store_id', 'order_item.product_id']);

0 commit comments

Comments
 (0)