diff --git a/vendor/magento/module-sales-rule/Model/ResourceModel/Rule.php b/vendor/magento/module-sales-rule/Model/ResourceModel/Rule.php index d65021e..200029d 100644 --- a/vendor/magento/module-sales-rule/Model/ResourceModel/Rule.php +++ b/vendor/magento/module-sales-rule/Model/ResourceModel/Rule.php @@ -305,14 +305,19 @@ class Rule extends AbstractResource public function getActiveAttributes() { $connection = $this->getConnection(); + $subSelect = $connection->select(); + $subSelect->reset(); + $subSelect->from($this->getTable('salesrule_product_attribute')) + ->group('attribute_id'); $select = $connection->select()->from( - ['a' => $this->getTable('salesrule_product_attribute')], - new \Zend_Db_Expr('DISTINCT ea.attribute_code') + ['a' => $subSelect], + new \Zend_Db_Expr('ea.attribute_code') )->joinInner( ['ea' => $this->getTable('eav_attribute')], 'ea.attribute_id = a.attribute_id', [] ); + return $connection->fetchAll($select); }