Using find() in Active Record with multiple where clause
问题 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. $query = Book::find() ->where('book_name LIKE :book_name', array(':book_name' => '%'.$book_name.'%')) ->orWhere('book_category LIKE :book_category', array(':book_category' =>'%'.$category.'%')) ->orWhere('finance_subcategory