Using find() in Active Record with multiple where clause

Dear All,

I want to divide (using brackets) following Active Record query in 3 groups. First group would be from first "Where" clause to last "orWhere". Second and third would be using "andWhere".

Please give me suggestions about how can I use brackets to separate all 3 sections.

Advance Thanks.

I am adding the solution for this -


$query = Book::find()

   ->where([

      'or',

   	['like', 'book_name', $book_name],

   	['like', 'book_category', $category],

   	['like', 'finance_subcategory', $category],

   	['like', 'insurance_subcategory', $category],

    ])

	->andWhere(['like', 'address', $address])

	->andWhere(['status' => 'Enabled'])

	->orderBy('book_id');

Thanks