framework icon indicating copy to clipboard operation
framework copied to clipboard

Columns not passed into getPaginationCount

Open alexdover opened this issue 12 years ago • 1 comments

I have been using the query builder to put together a complex query, which I wanted to paginate.

The count query wasn't working, because it was performing count(*) as aggregate which in my case needed to be count(distinct locations.id) as aggregate. I noticed that the paginate method accepts a second parameter of the columns to select, which defaults to array('*').

My query ended up going through the ungroupedPaginate method, but the $columns is not then passed to the getPaginationCount method, which means that they then don't get passed to the count method on the main query.

Hope this makes sense, I have modified my code to get it to work, which I am happy to put into a pull request - but I'm not sure if there was an intended reason for not passing the variable all the way through.

alexdover avatar Jul 04 '14 18:07 alexdover

You can make a pull request if you like. I believe there have been several back and forth issues on this. Pagination generally sucks to try to implement for all use cases. /cc @anlutro

taylorotwell avatar Jul 09 '14 02:07 taylorotwell