YII2中andWhere多个or查询
使用多个or的复杂查询:
AND ((`name`='张三') OR (`name`='李四') OR (`name`='王五')) // AND ((`name`='张三') OR (`name`='李四') OR (`name`='王五')) $query->andWhere(['or', ['name' => '张三'], ['name' => '李四'], ['name' => '王五'] ]); AND (((`name`='张三') AND (`phone`='15200000000')) OR ((`name`='李四') AND (`phone`='15300000000'))) // AND (((`name`='张三') AND (`phone`='15200000000')) OR ((`name`='李四') AND (`phone`='15300000000'))) $query->andWhere(['or', ['and', ['name' => '张三'], ['phone' => '15200000000'] ], ['and', ['name' => '李四'], ['phone' => '15300000000'] ] ]);
扫码二维码 获取免费视频学习资料
- 本文固定链接: http://phpxs.com/post/6774/
- 转载请注明:转载必须在正文中标注并保留原文链接
- 扫码: 扫上方二维码获取免费视频资料
查 看2022高级编程视频教程免费获取