I want to make an if else in filterArgs (in Model) as follow:
public $filterArgs = array(
array('name' => 'to', 'type' => 'value' => 'Product.regular_price' ),
);
I want the field to change base on the condition.
if sale = 1, field is promo_price, else field is regular_price
I already try below code (but unsuccessful):
'field'=> 'Product.sale' => 1 ? 'Product.promo_price >=' : 'Product.regular_price >='
Can someone please help me. Thanks alot in advance!