search

Home  >  Q&A  >  body text

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

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

巴扎黑巴扎黑2903 days ago361

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-10 16:58:57

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

    • null

    • ''

    • 空数组

    比如查询条件:

    orFilterWhere([
        'status' => 0,
        'name' => '',
        'age' => null,
        'sex' => []
     ])

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

    reply
    0
  • Cancelreply