Categories
Yii2. active record. How to group or and and requests?
Good afternoon How is it better to implement such a query using only the query builder? ( (a like '%1%') and (b like '%2%') ) and ( (a like '%X%') or (b like '%X%') )
Answer the question
In order to leave comments, you need to log in
///$query - activeQuery $query->filterWhere([ 'and', ['and', ['like', 'a', '1' ], ['like', 'b', '2' ]], ['or', ['like', 'a', 'x'], ['like', 'b', 'x']], ]);
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question