File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
app/code/Magento/SalesRule/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -305,17 +305,17 @@ public function getStoreLabel($ruleId, $storeId)
305305 public function getActiveAttributes ()
306306 {
307307 $ connection = $ this ->getConnection ();
308- $ subSelect = $ connection ->select ();
309- $ subSelect ->reset ();
310- $ subSelect ->from ($ this ->getTable ('salesrule_product_attribute ' ))
311- ->group ('attribute_id ' );
312308 $ select = $ connection ->select ()->from (
313- ['a ' => $ subSelect ],
314- new \Zend_Db_Expr ('ea.attribute_code ' )
309+ ['a ' => $ this -> getTable ( ' salesrule_product_attribute ' ) ],
310+ new \Zend_Db_Expr ('DISTINCT ea.attribute_code ' )
315311 )->joinInner (
316312 ['ea ' => $ this ->getTable ('eav_attribute ' )],
317313 'ea.attribute_id = a.attribute_id ' ,
318314 []
315+ )->joinInner (
316+ ['sr ' => $ this ->getTable ('salesrule ' )],
317+ 'a. ' . $ this ->getLinkField () . ' = sr. ' . $ this ->getLinkField () . ' AND sr.is_active = 1 ' ,
318+ []
319319 );
320320
321321 return $ connection ->fetchAll ($ select );
You can’t perform that action at this time.
0 commit comments