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)
305
305
public function getActiveAttributes ()
306
306
{
307
307
$ connection = $ this ->getConnection ();
308
- $ subSelect = $ connection ->select ();
309
- $ subSelect ->reset ();
310
- $ subSelect ->from ($ this ->getTable ('salesrule_product_attribute ' ))
311
- ->group ('attribute_id ' );
312
308
$ 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 ' )
315
311
)->joinInner (
316
312
['ea ' => $ this ->getTable ('eav_attribute ' )],
317
313
'ea.attribute_id = a.attribute_id ' ,
318
314
[]
315
+ )->joinInner (
316
+ ['sr ' => $ this ->getTable ('salesrule ' )],
317
+ 'a. ' . $ this ->getLinkField () . ' = sr. ' . $ this ->getLinkField () . ' AND sr.is_active = 1 ' ,
318
+ []
319
319
);
320
320
321
321
return $ connection ->fetchAll ($ select );
You can’t perform that action at this time.
0 commit comments