Skip to content

Commit

Permalink
MAGETWO-60246: [Backport] - [Github]Magento 2.1.1 Problem with change…
Browse files Browse the repository at this point in the history
… currency #6746 - for 2.1.x
  • Loading branch information
dhorytskyi committed Dec 1, 2017
1 parent fbd902a commit df3bfae
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ public function getAggregation(
\Magento\Framework\Search\Dynamic\EntityStorage $entityStorage
) {
$select = $this->dataProvider->getDataSet($bucket, $dimensions, $entityStorage->getSource());
list ($valueColumn, $currencyRateColumn) = $select->getPart(Select::COLUMNS);
$columns = $select->getPart(Select::COLUMNS);
$valueColumn = $columns[0][1];
$coefColumn = (isset($columns[1]) ? (string) $columns[1][1] : null);
$select->reset(Select::COLUMNS);
$rangeExpr = new \Zend_Db_Expr($this->connection->getIfNullSql(
$this->connection->quoteInto(
'FLOOR(' . $valueColumn[1] . ' * ' . (string) $currencyRateColumn[1] . ' / ? ) + 1',
'FLOOR(' . $valueColumn . ($coefColumn ? ' * ' . $coefColumn : '') . ' / ? ) + 1',
$range
),
1
Expand Down

0 comments on commit df3bfae

Please sign in to comment.