mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
Implemented option to specify pagesize when retrieving journals
This commit is contained in:
parent
17dad27610
commit
e7bb4a8ec6
@ -92,9 +92,9 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*
|
||||
* @return LengthAwarePaginator
|
||||
*/
|
||||
public function getJournalsOfTypes(array $types, int $offset, int $page)
|
||||
public function getJournalsOfTypes(array $types, int $offset, int $page, int $pagesize = 50)
|
||||
{
|
||||
$set = Auth::user()->transactionJournals()->transactionTypes($types)->withRelevantData()->take(50)->offset($offset)
|
||||
$set = Auth::user()->transactionJournals()->transactionTypes($types)->withRelevantData()->take($pagesize)->offset($offset)
|
||||
->orderBy('date', 'DESC')
|
||||
->orderBy('order', 'ASC')
|
||||
->orderBy('id', 'DESC')
|
||||
@ -102,7 +102,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
['transaction_journals.*']
|
||||
);
|
||||
$count = Auth::user()->transactionJournals()->transactionTypes($types)->count();
|
||||
$journals = new LengthAwarePaginator($set, $count, 50, $page);
|
||||
$journals = new LengthAwarePaginator($set, $count, $pagesize, $page);
|
||||
|
||||
return $journals;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user