0
鉴于此查询:如何将条件绑定到yii2活动记录查询?
Customers::find()
if(isset($request->post('hasPhone')))
->where(['=', 'has_phone', 1])
if(isset($request->post('hasEmail')))
->where(['=', 'has_email', 1])
->orderBy('id DESC');
我如何where
条款添加到查询,如果条件得到满足,并跳过他们,如果他们不?