在仓库中
$params = [ 'index' => 'my_index', 'type' => 'product', 'size' = $per_page; 'from' = $from; 'body' => [ 'query'=>['match'=>[ 'category'=>$category ]] ]; ];$response = Es::Search($params); $access = $response['hits']; return $access;
我在控制器中设置了$ per_page和$ from
$per_page = $request->get('limit', 10); $from = ($request->get('page', 1) - 1) * $per_page; $access = $this->repository->Index($per_page, $from); $admin_exceptions = new LengthAwarePaginator( $access['hits'], $access['total'], $per_page, Paginator::resolveCurrentPage(), ['path' => Paginator::resolveCurrentPath()]); return view('adminexception.index', compact('admin_exceptions'))->withInput($request->all());现在在视图{{!! $ admin_exceptions-> render()!!}}中使用render



