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'] ] ]);
#推薦:《 YII教學》
######以上是YII2中andWhere如何多個or查詢的詳細內容。更多資訊請關注PHP中文網其他相關文章!