2 回答

TA贡献1831条经验 获得超10个赞
你应该使用andFilterWhere()
$order_items = OrderItem::find()
->where(['location_id' => $model->location_name])
->andFilterWhere(['instructor_id' => $model->instructor_name])
->andwhere(['between', 'date', $model->from_date, $model->to_date ])
->all();

TA贡献1966条经验 获得超4个赞
$order_items= OrderItem::find()
->where(['location_id'=>$model->location_name,'instructor_id'=>$model->instructor_name])
->andWhere(['not', ['instructor_id' => null]])
->andwhere(['between', 'date', $model->from_date, $model->to_date ])->all();
或者添加以下内容
->andWhere(['<>', 'instructor_id', null])
或者
->andWhere('instructor_id IS NOT NULL')
- 2 回答
- 0 关注
- 217 浏览
添加回答
举报