public function search() {
$this->loadmodel('Usermgmt.User');
if ($this->request -> isPost()) {
$this->User->set($this->data);
$keyword=$this->data['Doctors']['search'];
$this->paginate['limit'] = 3;
$result = $this->paginate('User',array('conditions'=>$cond));
$this->set('result', $result);
}
这里显示错误:SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'条件'是cakephp-2.4.5
答案 0 :(得分:1)
paginate的第二个参数是$conditions因此:
$result = $this->paginate('User', $cond);
以下是另一个例子:
$data = $this->Paginator->paginate(
'Recipe',
array('Recipe.title LIKE' => 'a%')
);