Reputation: 1046
How can i customize the below query for multiple select status filter in a array using Yii2
Query: SELECT FROM STATUS WHERE ID IN (1, 2, 3, 4);
I need to convert above code like below FilterWhere format
Code:
$query->andFilterWhere([
'status' => $this->status
]);
I need to filter for multiple status.
Upvotes: 1
Views: 1257
Reputation: 303
This will help you ...
$query->andFilterWhere([ 'in','status',$this->status]);
Upvotes: 1