Skip to content

Commit

Permalink
Fixes Smile-SA#1223 and improves select statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Swahjak committed Dec 8, 2018
1 parent ab51ab3 commit 4ad0dad
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,12 @@ public function loadInventoryData($storeId, $productIds)
$tableName = $this->stockIndexTableProvider->execute($stockId);

$select = $this->getConnection()->select()
->from(['product' => $this->getTable('catalog_product_entity')], [])
->join(
['stock_index' => $tableName],
'product.sku = stock_index.' . IndexStructure::SKU,
[
'product_id' => 'product.entity_id',
'stock_status' => 'stock_index.' . IndexStructure::IS_SALABLE,
'qty' => 'stock_index.' . IndexStructure::QUANTITY,
]
);
->from($tableName, [
'product_id' => 'product_id',
'stock_status' => IndexStructure::IS_SALABLE,
'qty' => IndexStructure::QUANTITY,
])
->where('product_id IN(?)', $productIds);

return $this->getConnection()->fetchAll($select);
}
Expand Down

0 comments on commit 4ad0dad

Please sign in to comment.