mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Fixed search as well.
This commit is contained in:
@@ -103,16 +103,16 @@ class Search implements SearchInterface
|
|||||||
public function searchTransactions(array $words): Collection
|
public function searchTransactions(array $words): Collection
|
||||||
{
|
{
|
||||||
// decrypted transaction journals:
|
// decrypted transaction journals:
|
||||||
$decrypted = Auth::user()->transactionjournals()->withRelevantData()->where('encrypted', 0)->where( // TODO firefly will crash here.
|
$decrypted = Auth::user()->transactionjournals()->expanded()->where('encrypted', 0)->where(
|
||||||
function (EloquentBuilder $q) use ($words) {
|
function (EloquentBuilder $q) use ($words) {
|
||||||
foreach ($words as $word) {
|
foreach ($words as $word) {
|
||||||
$q->orWhere('description', 'LIKE', '%' . e($word) . '%');
|
$q->orWhere('description', 'LIKE', '%' . e($word) . '%');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)->get();
|
)->get(TransactionJournal::QUERYFIELDS);
|
||||||
|
|
||||||
// encrypted
|
// encrypted
|
||||||
$all = Auth::user()->transactionjournals()->withRelevantData()->where('encrypted', 1)->get(); // TODO firefly will crash here.
|
$all = Auth::user()->transactionjournals()->expanded()->where('encrypted', 1)->get(TransactionJournal::QUERYFIELDS);
|
||||||
$set = $all->filter(
|
$set = $all->filter(
|
||||||
function (TransactionJournal $journal) use ($words) {
|
function (TransactionJournal $journal) use ($words) {
|
||||||
foreach ($words as $word) {
|
foreach ($words as $word) {
|
||||||
|
Reference in New Issue
Block a user