File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
app/code/Magento/CatalogInventory/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -125,13 +125,23 @@ public function lockProductsStock($productIds, $websiteId)
125
125
return [];
126
126
}
127
127
$ itemTable = $ this ->getTable ('cataloginventory_stock_item ' );
128
- $ productTable = $ this ->getTable ('catalog_product_entity ' );
129
128
$ select = $ this ->getConnection ()->select ()->from (['si ' => $ itemTable ])
130
- ->join (['p ' => $ productTable ], 'p.entity_id=si.product_id ' , ['type_id ' ])
131
129
->where ('website_id=? ' , $ websiteId )
132
130
->where ('product_id IN(?) ' , $ productIds )
133
131
->forUpdate (true );
134
- return $ this ->getConnection ()->fetchAll ($ select );
132
+
133
+ $ productTable = $ this ->getTable ('catalog_product_entity ' );
134
+ $ selectProducts = $ this ->getConnection ()->select ()->from (['p ' => $ productTable ], [])
135
+ ->where ('entity_id IN (?) ' , $ productIds )
136
+ ->columns (
137
+ [
138
+ 'product_id ' => 'entity_id ' ,
139
+ 'type_id ' => 'type_id '
140
+ ]
141
+ );
142
+ $ this ->getConnection ()->query ($ select );
143
+
144
+ return $ this ->getConnection ()->fetchAll ($ selectProducts );
135
145
}
136
146
137
147
/**
You can’t perform that action at this time.
0 commit comments