title: How to do use nested condition in AndWhere in yii2
body: <p>Before marking as duplicate question,kindly read it. I have different problem here. I want to generate this kind of Query using yii2 search model.</p>
  
  <pre><code>select * from t1 innerjoin t2 on (t1.id = t2.id) where ((t1.price &gt;= '1000' and t1.price &lt;= '5000') OR 
                     ( t2.price &gt;= '1000' and t2.price &lt;= '5000' ))
  </code></pre>
  
  <p>Joining is not a problem here. The main problem is the where clause. I tried this but not working.</p>
  
  <pre><code>$query-&gt;andFilterWhere([
                       'and',
                       ['&gt;=', 't1.price', $this&gt;start_price],
                       ['&lt;=', 't1.price', $this-&gt;end_price]
                   ])
        -&gt;orFilterWhere([
                        'and',
                         ['&gt;=', 't2.price', $this-&gt;start_price],
                         ['&lt;=', 't2.price', $this-&gt;end_price]
                ]);
  </code></pre>