Hi Yii peeps,
Ok I have a query like so:
Contact::model()->with(array('emails'=>array( // want to get only users with emails 'joinType'=>'INNER JOIN', 'condition'=>"address like :q", 'params'=>array(':q'=>"%$q%") )))->nameLike($q)->findAll()
the nameLike() function is a scope and does a $this->getCDbCriteria()->mergeWith() and adds 1 condition that checks the first_name and last_name or company name is like the search term (which is the $q parameter) I want to add an or address (email address) is like the search parameter. At the moment the condition is appended to the query with an AND.
I have checked on the forums and only found people solve this by adding the or statement to the same condition string. This does not work in my case as i get something like
And (or address like var)
Any help would be great