Db:table('shop_goods')->count();
Here I executed one more Db query to query the total number of paging. I feel that the query efficiency is affected. Can I compare it with the query data set results? Share one? Just execute Db:table('shop_goods') once.
Didn’t you take out the result set directly? Check the length of the result set directly, and then divide it by how many pages are divided into. Once divided, the number of pages will come out. If it’s troublesome for you, just use the method provided by tp
Yes, it just depends on how you like to use it