I have this query which is working fine
$order_items= OrderItem::find()
->where(['location_id'=>$model->location_name,'instructor_id'=>$model->instructor_name])
->andwhere(['between', 'date', $model->from_date, $model->to_date ])->all();
But when $model->instructor_name
is empty or null, I am getting Null result.
So I want to ignore when instructor_id
is Null
when
'instructor_id'=>$model->instructor_name or instructor_id'=> Null
how I can do that?