I add some attributes for CDbCriteria class, and implement a filter.
When I add the condition attribute and parmas at the begin of auto generate code, ajax search is working, but If I add the both at the end of code, ajax get request is not work,
any one meet this problem? is it a bug with the class ?
public function search() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
//condition is working when use ajax search
$criteria->condition='project_id=:projectID';
$criteria->params=array(':projectID'=>$this->project_id);
$criteria->compare('id', $this->id);
$criteria->compare('name', $this->name, true);
$criteria->compare('description', $this->description, true);
$criteria->compare('project_id', $this->project_id);
$criteria->compare('owner_id', $this->owner_id);
$criteria->compare('requester_id', $this->requester_id);
$criteria->compare('status_id', $this->status_id);
$criteria->compare('type_id', $this->type_id);
$criteria->compare('create_time', $this->create_time, true);
$criteria->compare('create_user_id', $this->create_user_id);
$criteria->compare('update_time', $this->update_time, true);
$criteria->compare('update_user_id', $this->update_user_id);
//not working
//$criteria->condition='project_id=:projectID';
//$criteria->params=array(':projectID'=>$this->project_id);
return new CActiveDataProvider(get_class($this), array(
'criteria' => $criteria,
));
}