I would do it like this, when I’m using CActiveRecord and CDbCriteria
$criteria = new CDbCriteria;
$criteria->compare('price', '>'.$mimimumPrice);
if ($someCondition)
$criteria->compare('price', '<'.$maximumPrice);
$products = Product::model()->findAll($criteria);
In the above, the 1st "compare" will produce the condifion for "price > 100.00", and the 2nd will append the condition for "price < 500.00" and merge it with the 1st one using "AND".
Note that "compare()" and "addXxxCondition()" methods of CDbCriteria will add a new condition and merge it with the existing conditions using "AND" or "OR" (the default is "AND").