Hi
I've been using CI4 for a month now and I'm currently facing an issue with pagination.
If I'm using it as the doc says, everything's cool. I got my pages and links. But if I want to paginate a query with a join query, a group concat and group by, my results are bad.
PHP Code:
$this->foo = new FooModel();
$data['foo'] = $this->foo
->select('foo.*')
->select('GROUP_CONCAT(BAR_FOO_ID) as BAR_FOO_ID')
->join('bar_has_foo', 'BAR_FOO_ID = FOO_ID', 'LEFT')
->groupBy('FOO_ID')
->paginate(20);
$data['pager'] = $this->rtiers->pager;
If I dump $data['pager'], it says I have only one page with 20 results. But if I go to my view that have $data as a parameter, I can navigate to myurl?page=X without any problem.
Do you guys have any idea on how to work around this problem?
Thanks