Fix search.

This commit is contained in:
James Cole 2016-04-04 19:48:00 +02:00
parent 2d7f1af52c
commit 6490f9c128

View File

@ -103,7 +103,7 @@ class Search implements SearchInterface
public function searchTransactions(array $words): Collection
{
// decrypted transaction journals:
$decrypted = Auth::user()->transactionjournals()->expanded()->where('encrypted', 0)->where(
$decrypted = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 0)->where(
function (EloquentBuilder $q) use ($words) {
foreach ($words as $word) {
$q->orWhere('description', 'LIKE', '%' . e($word) . '%');
@ -112,7 +112,7 @@ class Search implements SearchInterface
)->get(TransactionJournal::QUERYFIELDS);
// encrypted
$all = Auth::user()->transactionjournals()->expanded()->where('encrypted', 1)->get(TransactionJournal::QUERYFIELDS);
$all = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 1)->get(TransactionJournal::QUERYFIELDS);
$set = $all->filter(
function (TransactionJournal $journal) use ($words) {
foreach ($words as $word) {