mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Take page size into account. [skip ci]
This commit is contained in:
@@ -138,14 +138,15 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate
|
||||
/**
|
||||
* @param Category $category
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getJournals(Category $category, $page): Collection
|
||||
public function getJournals(Category $category, int $page, int $pageSize = 50): Collection
|
||||
{
|
||||
$offset = $page > 0 ? $page * 50 : 0;
|
||||
$offset = $page > 0 ? $page * $pageSize : 0;
|
||||
|
||||
return $category->transactionjournals()->expanded()->take(50)->offset($offset)
|
||||
return $category->transactionjournals()->expanded()->take($pageSize)->offset($offset)
|
||||
->orderBy('transaction_journals.date', 'DESC')
|
||||
->orderBy('transaction_journals.order', 'ASC')
|
||||
->orderBy('transaction_journals.id', 'DESC')
|
||||
|
@@ -74,10 +74,11 @@ interface SingleCategoryRepositoryInterface
|
||||
/**
|
||||
* @param Category $category
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getJournals(Category $category, $page): Collection;
|
||||
public function getJournals(Category $category, int $page, int $pageSize = 50): Collection;
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
|
Reference in New Issue
Block a user