You mean a condition in a relation?
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'media'=>array(self::MANY_MANY, 'Media',
'model_has_media(model_id, media_id)',
'condition'=> 'model = "'.__CLASS__.'" AND metadata = ""',
),
'thumb'=>array(self::HAS_ONE, 'ModelHasMedia', 'model_id',
'condition'=> 'model = "'.__CLASS__.'" AND metadata = "thumbnail"',
),
'mediaCount'=>array(self::STAT, 'Media',
'model_has_media(model_id, media_id)',
'condition'=> 'model = "'.__CLASS__.'" AND metadata = ""',
),
'user' => array(self::BELONGS_TO, 'Users', 'user_id'),
);
}
If using a criteria in a dataprovider i think cannot there was a thread about it in the forum… (use search) where i found this 
<?php
class DataProvider extends CActiveDataProvider {
public $together = false;
/**
* Fetches the data from the persistent data storage.
* @return array list of data items
*/
protected function fetchData() {
$criteria = clone $this->getCriteria();
if (($pagination = $this->getPagination()) !== false) {
$pagination->setItemCount($this->getTotalItemCount());
$pagination->applyLimit($criteria);
}
if (($sort = $this->getSort()) !== false)
$sort->applyOrder($criteria);
if ($this->together) {
return CActiveRecord::model($this->modelClass)->with($criteria->with)->together()->findAll($criteria);
} else {
return CActiveRecord::model($this->modelClass)->findAll($criteria);
}
}
}
use like…
$criteria=new CDbCriteria(array(
'condition'=>'status = '.Books::STATUS_PUBLISHED,
'order'=>'t.id DESC',
'with'=> array('categories',
'alias' => 'categories',
),
));
$criteria->compare('categories.slug', $cat_name);
foreach($cat_children as $cat){
$criteria->compare('categories.slug', $cat->name, false, 'OR');
}
$dataProvider = new DataProvider('Books', array(
'criteria'=> $criteria,
'pagination'=>array(
'pageSize'=>self::PAGE_SIZE,
),
'together' => true
));