select lead.*,city.cityName,state.stateName,leadSourceMaster.leadSource,leadStageMaster.leadStage,leadStatusMaster.leadStatus FROM lead left join city on (city.cityId=lead.cityId) left Join state on (state.stateId=lead.stateId)left join leadSourceMaster on (leadSourceMaster.leadSourceId=lead.leadSourceId) left join leadStageMaster on (leadStageMaster.leadStageId=lead.leadStageId)left join leadStatusMaster on (leadStatusMaster.leadStatusId=lead.leadStatusId) where lead.name=$name AND lead.leadStageId=$stage AND lead.leadStatusId=$status;
Now is need to convert this query into yii framework style.
Funda is that. User will enter filter conditions like name,leadstage,leadstatus all 3 or can any one among 3.
I need to fetch records using CActiveDataProvider. Can any body help me to do this. Help will be appreciable.
$criteria = new CDbCriteria;
$criteria->select = 't.*, tu.* ';
$criteria->join = ' LEFT 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);
Can you please write the full query for me. actually i am new to yii and after lots of efforts i cant write this in correct way. please write full query with CActiveDataProvider. But i can’t use findAll(). Must use CActiveDataProvider.