CompanyModel::with(['user'=>function($query) use($search){ $query->field('user_id,user_name,company_id')->where($search['ucon']); }])->field('id,name,title,type,utm_tag,status')->where($search['con'])->paginate(15);
这样一段代码,怎样写: 闭包条件不满足时,都查不出来数据;
现在是,闭包条件不满足时候,companymodel表中的数据都出来了;
四季花海