ciao ragazzi
ho una query sql che non riesco a farla trasformare in query builder
SQL= "SELECT r.id as id, r.date as date, r.title as title,r.description as description, s.description as source_id, r.inserted_on as inserted_on
FROM researches r
LEFT JOIN sources s ON s.id=r.source_id
WHERE s.id=".$model->source_id." OR r.title LIKE '".%$model->title%."' OR r.tag LIKE '".$tag1."' OR r.tag LIKE '".$tag2."';
$rs = Yii::app()->db->createCommand()->select('r.id as id, r.date as date, r.title as title,r.description as description, s.description as source_id, r.inserted_on as inserted_on')
->from('researches r')
->leftJoin('sources s', 's.id=r.source_id')
->where("")
->queryAll();
Sono riuscito a fare tutto tranne la where che non ho idea di come fare.