How To Call Search Cretria With Condtion Make Two Tables Values In One Search Function

in my relation have a three tables like

public function relations()


	// NOTE: you may need to adjust the relation name and the related

	// class name for the relations automatically generated below.

	return array(

                'job' => array(self::BELONGS_TO, 'Jobprovider', 'JobProviderId'),

                'jobseeker' => array(self::BELONGS_TO, 'Jobseeker', 'JobSeekerId'),

                'jobpost' => array(self::BELONGS_TO, 'Jobpost', 'JobId'),





i want how to make search condition in one search function cretria with condition with two model relation my code is like

public function appCandidateSearch1($name)



	$criteria=new CDbCriteria;

             $criteria->with = array('jobseeker');






            $criteria->together = true; 

            $criteria->with = array('jobpost');

            $criteria->compare('jobpost.JobTitle', $this->title=$name,true,"OR");


            $criteria->compare('jobseeker.UserName', $this->name3,true,"OR");

            $criteria->compare('jobseeker.EmailId', $this->Email,true);

            $criteria->compare('work.JobSeekerID', $this->company1,true);




	return new CActiveDataProvider($this, array(






            'desc'=>'job.Emaild DESC',




            'desc'=>'jobseeker.EmailId DESC',












at a time i calling two cretria with that time its given sql query error column not found error please help