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->compare('t.ApplicationId',$this->ApplicationId);
$criteria->compare('t.JobProviderId',$this->JobProviderId);
$criteria->compare('t.JobId',$this->JobId);
$criteria->compare('t.JobSeekerId',$this->JobSeekerId);
$criteria->compare('t.AppliedOn',$this->AppliedOn,true);
$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(
'criteria'=>$criteria,
'sort'=>array(
'attributes'=>array(
'name2'=>array(
'asc'=>'job.Emaild',
'desc'=>'job.Emaild DESC',
),
'Email'=>array(
'asc'=>'jobseeker.EmailId',
'desc'=>'jobseeker.EmailId DESC',
),
'name3'=>array(
'asc'=>'jobseeker.UserName',
'desc'=>'jobseeker.UserName',
),
'*',
))
));
}
at a time i calling two cretria with that time its given sql query error column not found error please help