I'm using CDbCriteria to filter a CListView (Products page)
$criteria = new CDbCriteria();
$criteria->join ='LEFT JOIN collections ON collections.id = t.collection_id';
(isset($_GET['name'])) ? $name = $_GET['name'] : $name = "";
$criteria->addCondition('t.name LIKE :name');
$criteria->params = array(':name' => "%$name%");
$criteria->order = 't.name asc';
//get count
$count = Products::model()->count($criteria);
But the problem: In the products model I have a virtual attribute named ProductFinalPrice what calculates the final price based on user role & product category and user specific product price.
How can I sort by this virtual attribute?