Skip to content

Commit

Permalink
Fix addExpressionFieldToSelect method generated columns get overwrite…
Browse files Browse the repository at this point in the history
…n by addFieldToSelect()
  • Loading branch information
Magently committed Aug 24, 2018
1 parent 0ddea98 commit e9451e0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ public function addExpressionFieldToSelect($alias, $expression, $fields)
$fullExpression = str_replace('{{' . $fieldKey . '}}', $fieldItem, $fullExpression);
}

$this->getSelect()->columns([$alias => $fullExpression]);
$fullExpression = new \Zend_Db_Expr($fullExpression);
$this->_fieldsToSelect[$alias] = $fullExpression;
$this->_fieldsToSelectChanged = true;

return $this;
}
Expand Down

0 comments on commit e9451e0

Please sign in to comment.