Skip to content

Commit

Permalink
ENGCOM-3622: [Backport] Fix typo in SQL join when joining custom opti…
Browse files Browse the repository at this point in the history
…on prices for price indexer [2.2] #19552
  • Loading branch information
sivaschenko authored Mar 6, 2019
2 parents d14e221 + a4677e3 commit b5a849b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
}

/**
* Check if custom options exist.
*
* @param IndexTableStructure $priceTable
* @return bool
* @throws \Exception
Expand Down Expand Up @@ -154,6 +156,8 @@ private function checkIfCustomOptionsExist(IndexTableStructure $priceTable): boo
}

/**
* Get connection.
*
* @return \Magento\Framework\DB\Adapter\AdapterInterface
*/
private function getConnection()
Expand Down Expand Up @@ -211,7 +215,7 @@ private function getSelectForOptionsWithMultipleValues(string $sourceTable): Sel
} else {
$select->joinLeft(
['otps' => $this->getTable('catalog_product_option_type_price')],
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cwd.default_store_id',
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cwd.default_store_id',
[]
);

Expand Down Expand Up @@ -373,6 +377,8 @@ private function getSelectAggregated(string $sourceTable): Select
}

/**
* Get select for update.
*
* @param string $sourceTable
* @return \Magento\Framework\DB\Select
*/
Expand Down Expand Up @@ -402,6 +408,8 @@ private function getSelectForUpdate(string $sourceTable): Select
}

/**
* Get table name.
*
* @param string $tableName
* @return string
*/
Expand All @@ -411,6 +419,8 @@ private function getTable(string $tableName): string
}

/**
* Is price scope global.
*
* @return bool
*/
private function isPriceGlobal(): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/**
* Default Product Type Price Indexer Resource model
*
* For correctly work need define product type id
*
* @api
Expand Down Expand Up @@ -208,6 +209,8 @@ public function reindexEntity($entityIds)
}

/**
* Reindex prices.
*
* @param null|int|array $entityIds
* @return \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
*/
Expand Down Expand Up @@ -604,7 +607,7 @@ protected function _applyCustomOption()
[]
)->joinLeft(
['otps' => $this->getTable('catalog_product_option_type_price')],
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cs.store_id',
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cs.store_id',
[]
)->group(
['i.entity_id', 'i.customer_group_id', 'i.website_id', 'o.option_id']
Expand Down Expand Up @@ -802,6 +805,8 @@ public function getIdxTable($table = null)
}

/**
* Check if product exists.
*
* @return bool
*/
protected function hasEntity()
Expand All @@ -823,6 +828,8 @@ protected function hasEntity()
}

/**
* Get total tier price expression.
*
* @param \Zend_Db_Expr $priceExpression
* @return \Zend_Db_Expr
*/
Expand Down Expand Up @@ -862,6 +869,13 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression)
);
}

/**
* Get tier price expression for table.
*
* @param string $tableAlias
* @param \Zend_Db_Expr $priceExpression
* @return \Zend_Db_Expr
*/
private function getTierPriceExpressionForTable($tableAlias, \Zend_Db_Expr $priceExpression)
{
return $this->getConnection()->getCheckSql(
Expand Down

0 comments on commit b5a849b

Please sign in to comment.