Cakephp cakedc搜索插件使用pb
我使用插件cakedc搜索,但有一件事我似乎找不到,我有一个带有两个字段的表单,我会在搜索中添加例如“online=1” 在我的控制器中,我正在尝试:Cakephp cakedc搜索插件使用pb,cakephp,plugins,cakedc,Cakephp,Plugins,Cakedc,我使用插件cakedc搜索,但有一件事我似乎找不到,我有一个带有两个字段的表单,我会在搜索中添加例如“online=1” 在我的控制器中,我正在尝试: public function find() { $this->Prg->commonProcess(); $array = array('type'=>'post', 'online'=>'1', 'created'=> '<= NOW()'); $this->passedArgs = S
public function find() {
$this->Prg->commonProcess();
$array = array('type'=>'post', 'online'=>'1', 'created'=> '<= NOW()');
$this->passedArgs = Set::merge($this->passedArgs, $array);
$this->paginate = array(
'conditions' => array($this->Post->parseCriteria($this->passedArgs)),
);
$this->set('posts', $this->paginate());
调试($this->passedArgs):
数组(
'name'=>'mon',
'category_id'=>'2',
'type'=>'post',
“在线”=>“1”,
“已创建”=>“而不是
'conditions' => array($this->Post->parseCriteria($this->passedArgs)),
试一试
我还建议您使用DebugKit,并在问题仍然不起作用的情况下将生成的查询添加到问题中。请参阅
array(
'name' => 'mon',
'category_id' => '2',
'type' => 'post',
'online' => '1',
'created' => '<= NOW()'
)
'conditions' => array($this->Post->parseCriteria($this->passedArgs)),
'conditions' => $this->Post->parseCriteria($this->passedArgs),