简体   繁体   English

分页页面问题集合/数组

[英]Pagination pages problem collection / array

I've used the query builder instead of the normal select(I had to, I have added pagination).我使用了查询生成器而不是普通的选择(我必须这样做,我已经添加了分页)。 query builder example:查询构建器示例:

$dataGlobal = DB::table('articles')
->orderBy('articleDate', 'desc')
->orderBy('articleHour', 'desc')
->orderBy('articleMinute', 'asc')
->orderBy('articleSeconde', 'asc')
->limit(150)
->paginate(15); 

With this code, normally I shoud have 10 pages no more, but instead of the 10 pages I have 23. Counting from page 5 to 23, all of these pages aren't working with this error code;使用此代码,通常我应该不再有 10 页,但我有 23 页而不是 10 页。从第 5 页计数到第 23 页,所有这些页面都无法使用此错误代码; Undefined array key 0未定义的数组键 0

For the pagination I'm using the bootstrap 5 blade pagination (vendor folder)对于分页,我使用的是 bootstrap 5 刀片分页(供应商文件夹)

My question is why am I having all of theese pages?我的问题是为什么我拥有所有这些页面? The weird thing is I have this problem in one page only which is my home page, but in the other ones I don't have this problem at all everything is good奇怪的是我只有一个页面有这个问题,这是我的主页,但在其他页面我根本没有这个问题,一切都很好

Maybe I didn't give enought details let me know if you guys need me to add something.也许我没有提供足够的细节让我知道你们是否需要我添加一些东西。

Actually, you can't use limit with pagination.实际上,您不能将限制与分页一起使用。

see this answer: Using limit parameter in paginate function看到这个答案: 在分页中使用限制参数 function

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM