我编辑了我的模型和模型;研究功能只是把数据与同一商业信息数据库看齐,但现在高级搜索并不奏效。
这里是我模型和模型研究的代码。
public function search() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->compare( LOVEAGENT_ID , $this->LOVEAGENT_ID);
$criteria->compare( FIRST_NAME , $this->FIRST_NAME, true);
$criteria->compare( LAST_NAME , $this->LAST_NAME, true);
$criteria->compare( DOB , $this->DOB, true);
$criteria->compare( PASSWORD , $this->PASSWORD, true);
............
$criteria->condition = BUSINESS_ID=:businessID ;
$criteria->params = array( :businessID => Yii::app()->user->businessId);
return new CActiveDataProvider($this, array(
criteria => $criteria,
;
}
我的行政管理人员:
public function actionAdmin() {
$model = new LoveAgentContactDetails( search );
$model->unsetAttributes(); // clear any default values
if (isset($_GET[ LoveAgentContactDetails ])) {
$model->attributes = $_GET[ LoveAgentContactDetails ];
}
$this->render( admin , array(
model => $model,
;
}
和电网观测环境:
$this->widget( zii.widgets.grid.CGridView , array(
id => love-agent-contact-details-grid ,
dataProvider => $model->search(),
filter => $model,
columns => array(
FIRST_NAME ,
LAST_NAME ,
lastLoginTime ,
created ,
array(
class => CButtonColumn ,
),
),
;