Answer the question
In order to leave comments, you need to log in
How to make queries in Yii2 with nested conditions?
Hello.
I didn’t quite understand how it is possible to implement in the query using ActiveQuery the conditions of the WHERE part of the form
condition1 AND ( condition2 OR condition 3 OR condition 4 ...)
there are andWhere and orWhere, but I can’t understand how to apply them here
Answer the question
In order to leave comments, you need to log in
For example, using where($condition), where $condition represents the following:
The result of the transformations in sql will look like this:status=1 AND (id=1 OR id=2)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question