From 10a2078661bb92401c4431b5cd1308f703758d31 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 13 Aug 2019 18:45:44 +0200 Subject: [PATCH] Fix #2404 --- app/Helpers/Collector/GroupCollector.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index c364719f0e..72209c3fea 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -87,7 +87,7 @@ class GroupCollector implements GroupCollectorInterface $this->total = 0; $this->limit = 50; - $this->page = 0; + $this->page = 1; $this->fields = [ # group 'transaction_groups.id as transaction_group_id', @@ -158,7 +158,7 @@ class GroupCollector implements GroupCollectorInterface $this->total = $collection->count(); // now filter the array according to the page and the - $offset = $this->page * $this->limit; + $offset = ($this->page-1) * $this->limit; return $collection->slice($offset, $this->limit); @@ -370,9 +370,9 @@ class GroupCollector implements GroupCollectorInterface */ public function setPage(int $page): GroupCollectorInterface { - $page = 0 === $page ? 0 : $page - 1; + $page = 0 === $page ? 1 : $page; $this->page = $page; - app('log')->debug(sprintf('GroupCollector: page is now %d (is minus 1)', $page)); + app('log')->debug(sprintf('GroupCollector: page is now %d', $page)); return $this; }