laravel-admin关联查询过滤

$grid->filter(function ($filter){

    $filter->where(function ($query) {

        $uid_list = \App\Models\MemberModel::query()->where('mobile', 'like', "%{$this->input}%")->select('id')->get()->toArray();

        $query->whereIn('member_id', $uid_list);

    }, '用户手机号');

}); 


发表评论