ban*_*cer 19
手册中的复杂查找条件:
$this->Post->find('first', array (
"Author.name" => "Bob",
"OR" => array (
"Post.title LIKE" => "%magic%",
"Post.created >" => date('Y-m-d', strtotime("-2 weeks"))
)
));
Run Code Online (Sandbox Code Playgroud)
您可以使用:用于“喜欢”
$this->Post->find("all",array('condition'=>array('Author LIKE'=>"ad%")));
Run Code Online (Sandbox Code Playgroud)
上面的查询将为您提供来自作者姓名以“ad”开头的表格帖子的数据。
对于“或”
$this->Post->find("all",array('condition'=>array("OR"=>array('Author LIKE'=>"ad%",'Post LIKE'=>"bo%"))));
Run Code Online (Sandbox Code Playgroud)
上面的查询将为您提供来自表帖子的数据,其中作者姓名以“ad”开头或帖子以“bo”开头。
| 归档时间: |
|
| 查看次数: |
32261 次 |
| 最近记录: |