Using Multiple Tables In _View.php With Clistview

Hello , I’m almost new in yii and I want to use multiple tables records in _view.php , because my model has relationship with some other tables and i want to show those tables information instead of related field.

can anyone help me??

Hi

you can write a join query using CdbCriteria


$criteria = new CDbCriteria;

$criteria->select = 't.*, tu.* ';

$criteria->join = ' JOIN `user_crew` AS `tu` ON t.id = tu.user_id';

$criteria->addCondition("display_name LIKE '%a%' and blocked_by='76'");

$resultSet    =    Customer::model()->findAll($criteria);

and pass this object in view model


$this->renderPartial('_view',array('resultSet' => $resultSet,));