Home > Backend Development > PHP Tutorial > Yii2 ARwhere查询 orWhere 和orFilterWhere 啥区别呢??

Yii2 ARwhere查询 orWhere 和orFilterWhere 啥区别呢??

WBOY
Release: 2016-06-06 20:16:20
Original
1842 people have browsed it

Yii2 ARwhere查询 orWhere 和orFilterWhere 啥区别呢??

回复内容:

Yii2 ARwhere查询 orWhere 和orFilterWhere 啥区别呢??

filter的操作内部会过滤掉为空的条件

  • null

  • ''

  • 空数组

比如查询条件:

<code>orFilterWhere([
    'status' => 0,
    'name' => '',
    'age' => null,
    'sex' => []
 ])</code>
Copy after login

最后去掉为的组成查询条件,依据规则就剩下status = 0这个条件了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template