我在一个页面上处理两个分页,并且分页链接无法正常工作 .

情况如下:我得到了Eloquent对象,我对它进行排序并执行一些过程,然后将其转换为两个单独的集合 . 现在我有两个我用“Lengthawarepaginator”转移的集合 - 并通过方法“setPageName()”为每个集合添加了分页名称 . (我必须通过自定义paginate执行此操作,因为我正在使用这些,因此更具体的Eloquent查询是不可能的) .

一切都很完美;当我点击任意这两个分页的任何分页链接时 - 它显示该分页的正确分页结果,简单完美 .

但是,分页链接无法正常显示 - 即当我点击第2,3,4页时 - 即使我显示正确的分页页面 - 分页链接始终保持在第一位 - 看起来就像是显示第1页的分页(甚至显示例如2,3,4分页页面结果) - 简单地说 - 分页链接不遵循所示的适当分页页面 . 此外,分页的第1页链接根本无法点击 .

这是我的控制器代码:

$currentPage=LengthAwarePaginator::resolveCurrentPage('popular')-1;
    $perPage=10;
    $currentPageBlogResults = $items1->slice($currentPage * $perPage, $perPage)->all();
    $items1= new LengthAwarePaginator($currentPageBlogResults, count($items1), $perPage);
    $items1->setPath('offers');
    $items1->setPageName('popular');


    $currentPage=LengthAwarePaginator::resolveCurrentPage('highlow')-1;
    $perPage=10;
    $currentPageBlogResults = $items2->slice($currentPage * $perPage, $perPage)->all();
    $items2= new LengthAwarePaginator($currentPageBlogResults, count($items2), $perPage);
    $items2->setPath('offers');
    $items2->setPageName('highlow');

对于视图:我只是简单地预测每个和每个下面的结果我只是回应分页链接,如: {{$items1->links() }}{{$items2->links () }}

有什么建议?