$grid->filter(function($filter){}中如何创建关联表的LIKE查询,已对应好关系
$filter->where(function ($query) {
$query->whereHas('profile', function ($query) {
$query->where('address', 'like', "%{$this->input}%")->orWhere('email', 'like', "%{$this->input}%");
});
}, '地址或手机号');
上面是官方1.5文档的写法,我照着写报错,我在1.4的文档中好像没有看到,是因为1.4没有嘛?
报什么错?1.4应该是有的
已解决,是我自己写错了,where的第二个参数放错地方了。。。。一层一层的方法。。
Most helpful comment
报什么错?1.4应该是有的