I am trying to display a table with details of "orders" from my database, but limited by some criteria. I have:
$provider = new CActiveDataProvider('Order'); $provider->criteria = [ 'scopes' => ['active', 'lastDay'], ];
where active and lastDay refer to functions in my Order model that retrieve the appropriate records.
How do I change my above code so that instead of the ‘lastDay’ scope, I instead limit the retrieved orders by the order ‘state’, which is another property in my Order model, and which can have values of 0, 1, 2, 3, 4 or 5. Let’s say I want to display orders that have a state of 0, 1 or 2. I have the function in my Order model to retrieve orders according to ‘state’, but I’m not sure how to specify the ‘state’ as a scope, where multiple values are acceptable.