Mar 21, 2022
0
Level 1
lumen cursorPaginate error when OrderBy is 0
I have a problem with cursorPaginate
When I arrange the data using orderBy, the pages arrive until the number is zero for example
Any::OrderByDesc('views')->cursorPaginate();
The Sql Code
SELECT *
FROM `any`
ORDER BY `views` DESC
LIMIT 6
Page 2 (load more)
SELECT *
FROM `any`
WHERE (`views` < 45)
ORDER BY `views` DESC
LIMIT 6
Page 3 (load more)
SELECT *
FROM `any`
WHERE (`views` < 0)
ORDER BY `views` DESC
LIMIT 6
In this case it is impossible for views to be less than 0
Only arrays and objects are supported when cursor paginating items.
Please or to participate in this conversation.