$query->where('pole = :value and (pole1 = :value1 or pole2 = :value2)');
$query->params([':value'=>"value", ':value1' => 'value1', ':value2' => 'value2']);
$query->params([':value'=>"value", ':value1' => 'value1', ':value2' => 'value2']);
$query->Where(['and', 'value = :value', ['or', 'value1 = :value1', 'value2 = :value2']]);
$dataProvider=new CActiveDataProvider('Model', array(
'Sort'=>array(
'defaultOrder'=>'t.id DESC',
'attributes'=>array(
'CityName'=>array(
'asc'=>'_city.name',
'desc'=>'_city.name DESC',
'label'=>'Город,
'default'=>'asc',
),
'*',
),
),
...
'sortableAttributes'=>array(
...
'CityName',
...
),