When using listExtendQuery with groupby, paginate seems not work
@bennothommo is already working on this.
Since Nov 30, 2022.
- Dominant language
- PHP
- Stars
- 1.5k
- Forks
- 246
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 7
Description
Winter CMS Build
Other (please specify below)
PHP Version
7.4
Database engine
MySQL/MariaDB
Plugins installed
No response
Issue description
Hello everyone.
I have a model listing, where I need to override the standard querie, using a groupBy that returns the desired results, according to the business rule. The values that appear as "totals" in the pagination are correct.
The problem is, when doing this:
public function listExtendQuery($query)
{
$query->groupBy('column');
}
And when trying to move from one page to another, it just doesn't load. I get stuck on the first page.
See: the pagination widget is loaded, but it doesn't work when I click next page...
Does anyone have any ideas?
Steps to replicate
• Use any model with some data
• In the controller of above's model, use the listExtendQuery to override default querie using: $query->groupBy('some_column')
• Try to click in the next step indicator
Workaround
Nothing yet.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.