X
X
xaseros2015-06-12 22:31:31
SQL
xaseros, 2015-06-12 22:31:31

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

1 answer(s)
I
ivankomolin, 2015-06-14
@xaseros

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 question

Ask a Question

731 491 924 answers to any question