扫码关注官方订阅号
Yii2 ARwhere查询 orWhere 和orFilterWhere 啥区别呢??
带filter的操作内部会过滤掉为空的条件
filter
空的条件
null
''
空数组
比如查询条件:
orFilterWhere([ 'status' => 0, 'name' => '', 'age' => null, 'sex' => [] ])
最后去掉为空的组成查询条件,依据规则就剩下status = 0这个条件了
空
status = 0
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
带
filter的操作内部会过滤掉为空的条件null
''
空数组
比如查询条件:
最后去掉为
空的组成查询条件,依据规则就剩下status = 0这个条件了