mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #2404
This commit is contained in:
parent
3fb09136cf
commit
10a2078661
@ -87,7 +87,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
|
|
||||||
$this->total = 0;
|
$this->total = 0;
|
||||||
$this->limit = 50;
|
$this->limit = 50;
|
||||||
$this->page = 0;
|
$this->page = 1;
|
||||||
$this->fields = [
|
$this->fields = [
|
||||||
# group
|
# group
|
||||||
'transaction_groups.id as transaction_group_id',
|
'transaction_groups.id as transaction_group_id',
|
||||||
@ -158,7 +158,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
$this->total = $collection->count();
|
$this->total = $collection->count();
|
||||||
|
|
||||||
// now filter the array according to the page and the
|
// 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);
|
return $collection->slice($offset, $this->limit);
|
||||||
|
|
||||||
@ -370,9 +370,9 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
*/
|
*/
|
||||||
public function setPage(int $page): GroupCollectorInterface
|
public function setPage(int $page): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$page = 0 === $page ? 0 : $page - 1;
|
$page = 0 === $page ? 1 : $page;
|
||||||
$this->page = $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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user