Magento Collection with nested "OR" "AND" Filter -
i try filter collection have nest "or" "and" filter t_id & t_code both attributes
$collection->addattributetofilter( array( array( 'attribute' => 't_id', 'null' => true ), array( 'attribute' => 't_id', 'finset' => $allowedtid ) ) ); $collection->addattributetofilter( array( array( 'attribute' => 't_code', 'null' => true ), array( 'attribute' => 't_code', 'finset' => $tattcode ) ) );
here sql of query
where ((at_t_id.value null) or (find_in_set('', at_t_id.value))) , ((at_t_code.value null) or (find_in_set('2348', at_t_code.value)))
but trying this
(at_t_id.value null) or ( (find_in_set('1245', at_t_id.value)) , ( (at_t_code.value null) or (find_in_set('2348', at_t_code.value)) ) )
is there way can achieved?
Comments
Post a Comment