我有这个工作正常的查询
$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();
但是当$model->instructor_name为空或空时,我得到空结果。所以我想忽略何时instructor_id为空
'instructor_id'=>$model->instructor_name or instructor_id'=> Null
我怎么能做到这一点?
慕哥6287543
慕标5832272