mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Covered the JSON controller.
This commit is contained in:
@@ -62,6 +62,26 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
return $journal->transactions()->first()->account_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionType $dbType
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getJournalsOfType(TransactionType $dbType)
|
||||
{
|
||||
return Auth::user()->transactionjournals()->where('transaction_type_id', $dbType->id)->orderBy('id', 'DESC')->take(50)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $type
|
||||
*
|
||||
* @return TransactionType
|
||||
*/
|
||||
public function getTransactionType($type)
|
||||
{
|
||||
return TransactionType::whereType($type)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param TransactionJournal $journal
|
||||
@@ -289,5 +309,4 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
|
||||
return [$from, $to];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user