我在方法模型中添加了来自连接属性 ( event.deleted_at
, event.status
) 的参数:defaultScope
public function defaultScope()
{
return array(
'condition'=>'
lp_deleted_at is NULL
AND event.e_deleted_at IS NULL
AND event.status = TRUE
'
);
}
addSearchCondition
创建条件时,最后一行 ( ) 出错:
$criteria=new CDbCriteria;
$criteria->with = array(
'lokasi_pengamatan'=>array('select'=>'lokasi_pengamatan.nama','together'=>true),
'event'=>array('select'=>'event.id_event','together'=>true)
$criteria->addSearchCondition('lokasi_pengamatan.nama', '%'.$this->lokasi_pengamatan.'%', false, 'AND', 'ILIKE');
错误信息
Undefined table: 7 ERROR: missing FROM-clause entry for table "event"