isSuperAdmin()) ||Gate::allows('供应商-可见全部')) return Supplier::query()->get()->map(function ($supplier){return $supplier->id;})->toArray(); $suppliers=Supplier::query() ->whereHas('user',function($query)use($user){ /** @var Builder $query */ return $query->where('id',$user->id); })->get(); if (isset($suppliers)) return $suppliers->map(function ($supplier){ return $supplier->id; })->toArray(); } }