
I need search first_name and last_name through relations of the model MessageLog
I tried things like:
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->with=array(); $criteria->compare('id',$this->id); $criteria->compare('message_id',$this->message_id); //$criteria->compare('media_id',$this->media_id); array_push($criteria->with,'media.person'); $criteria->addSearchCondition('LOWER(media.person.first_name)', strtolower($this->person_id)); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
or
array_push($criteria->with,'media'); $criteria->addSearchCondition('LOWER(media.person.first_name)', strtolower($this->person_id));
But everything I've tried fail
i will appreciate your help. best regards...