I'm on project of YII
. I have Production
table, where I have category_id
and brand_id
two column. Now what I want to do is, just use the CActiveDataProvider
to fetch those particular rows to the $dataprovider
which has those category_id
and brand_id
in my $cat
and $brnd
array. I made it for category_id
, but I am not getting any thing how to put both of them on the condition. Here is my code, please help.
$dataProvider=new CActiveDataProvider(Production::model(),
array(
'criteria'=>array('condition' => 'category_id IN ('.implode(',',$cat).')'),
'pagination' => array('pageSize'=>Yii::app()->params['productsPerPage']),
)
);