Skip to content

Commit 99b3cd4

Browse files
committed
CDP-5138
1 parent 0eb1684 commit 99b3cd4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Model/Api/ProductsApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ protected function handleCategoryIds()
142142
{
143143
$this->productHelper->getCategoryIds(
144144
[
145-
['product_id >= ?', $this->minId],
146-
['product_id <= ?', $this->maxId],
145+
['entity_table.' . $this->linkField . ' >= ?', $this->minId],
146+
['entity_table.' . $this->linkField . ' <= ?', $this->maxId],
147147
]
148148
);
149149

Model/ResourceModel/Api/Category.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,20 @@ public function getCategoryIds($wheres, $joinInner = null)
6666
{
6767
$this->categoryIds = [];
6868

69+
$categoryTable = $this->getTable('catalog_category_product');
70+
6971
$categoryQuery = $this->_resource->getConnection()->select()
7072
->from(
71-
$this->getTable('catalog_category_product'),
73+
$categoryTable,
7274
['category_id', 'product_id']
75+
)->joinLeft(
76+
[
77+
'entity_table' => $this->getTable(
78+
'catalog_product_entity'
79+
),
80+
],
81+
'entity_table.entity_id = ' . $categoryTable . '.product_id',
82+
[]
7383
);
7484

7585
foreach ($wheres as $where) {

0 commit comments

Comments
 (0)