Fixed search as well.

This commit is contained in:
James Cole
2016-03-02 13:56:56 +01:00
parent 2e7703bc97
commit 2fd476ada8

View File

@@ -103,16 +103,16 @@ class Search implements SearchInterface
public function searchTransactions(array $words): Collection
{
// 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) {
foreach ($words as $word) {
$q->orWhere('description', 'LIKE', '%' . e($word) . '%');
}
}
)->get();
)->get(TransactionJournal::QUERYFIELDS);
// 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(
function (TransactionJournal $journal) use ($words) {
foreach ($words as $word) {