From 9463285ac939e29916d68a3f475c61868b428bd9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 10 Oct 2024 06:32:40 +0200 Subject: [PATCH] Fix https://github.com/orgs/firefly-iii/discussions/9324 --- .../Collector/Extensions/MetaCollection.php | 22 +++++++++---------- app/Helpers/Collector/GroupCollector.php | 12 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index a2febb88c6..442e5842b5 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -200,7 +200,7 @@ trait MetaCollection $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'internal_reference'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s%%', $internalReference)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s%%', $internalReference)); return $this; } @@ -233,7 +233,7 @@ trait MetaCollection $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_id'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s%%', $externalId)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s%%', $externalId)); return $this; } @@ -245,7 +245,7 @@ trait MetaCollection $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_id'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s"', $externalId)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s"', $externalId)); return $this; } @@ -303,7 +303,7 @@ trait MetaCollection $url = (string)json_encode($url); $url = str_replace('\\', '\\\\', trim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s%%', $url)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s%%', $url)); return $this; } @@ -314,7 +314,7 @@ trait MetaCollection $url = (string)json_encode($url); $url = str_replace('\\', '\\\\', ltrim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s', $url)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s', $url)); return $this; } @@ -327,7 +327,7 @@ trait MetaCollection // var_dump($url); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%s%%', $url)); + $this->query->whereNotLike('journal_meta.data', sprintf('%s%%', $url)); return $this; } @@ -416,7 +416,7 @@ trait MetaCollection $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'internal_reference'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s%%', $internalReference)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s%%', $internalReference)); return $this; } @@ -428,7 +428,7 @@ trait MetaCollection $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'internal_reference'); - $this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s"', $internalReference)); + $this->query->whereNotLike('journal_meta.data', sprintf('%%%s"', $internalReference)); return $this; } @@ -502,7 +502,7 @@ trait MetaCollection $this->withNotes(); $this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line $q->whereNull('notes.text'); - $q->orWhere('notes.text', 'NOT LIKE', sprintf('%%%s%%', $value)); + $q->orWhereNotLike('notes.text', sprintf('%%%s%%', $value)); }); return $this; @@ -513,7 +513,7 @@ trait MetaCollection $this->withNotes(); $this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line $q->whereNull('notes.text'); - $q->orWhere('notes.text', 'NOT LIKE', sprintf('%%%s', $value)); + $q->orWhereNotLike('notes.text', sprintf('%%%s', $value)); }); return $this; @@ -524,7 +524,7 @@ trait MetaCollection $this->withNotes(); $this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line $q->whereNull('notes.text'); - $q->orWhere('notes.text', 'NOT LIKE', sprintf('%s%%', $value)); + $q->orWhereNotLike('notes.text', sprintf('%s%%', $value)); }); return $this; diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index ea0f18e02e..c7e9a98d6c 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -156,7 +156,7 @@ class GroupCollector implements GroupCollectorInterface static function (EloquentBuilder $q1) use ($array): void { foreach ($array as $word) { $keyword = sprintf('%%%s', $word); - $q1->where('transaction_journals.description', 'NOT LIKE', $keyword); + $q1->whereNotLike('transaction_journals.description', $keyword); } } ); @@ -164,7 +164,7 @@ class GroupCollector implements GroupCollectorInterface static function (EloquentBuilder $q2) use ($array): void { foreach ($array as $word) { $keyword = sprintf('%%%s', $word); - $q2->where('transaction_groups.title', 'NOT LIKE', $keyword); + $q2->whereNotLike('transaction_groups.title', $keyword); $q2->orWhereNull('transaction_groups.title'); } } @@ -183,7 +183,7 @@ class GroupCollector implements GroupCollectorInterface static function (EloquentBuilder $q1) use ($array): void { foreach ($array as $word) { $keyword = sprintf('%s%%', $word); - $q1->where('transaction_journals.description', 'NOT LIKE', $keyword); + $q1->whereNotLike('transaction_journals.description', $keyword); } } ); @@ -191,7 +191,7 @@ class GroupCollector implements GroupCollectorInterface static function (EloquentBuilder $q2) use ($array): void { foreach ($array as $word) { $keyword = sprintf('%s%%', $word); - $q2->where('transaction_groups.title', 'NOT LIKE', $keyword); + $q2->whereNotLike('transaction_groups.title', $keyword); $q2->orWhereNull('transaction_groups.title'); } } @@ -379,7 +379,7 @@ class GroupCollector implements GroupCollectorInterface static function (EloquentBuilder $q1) use ($array): void { foreach ($array as $word) { $keyword = sprintf('%%%s%%', $word); - $q1->where('transaction_journals.description', 'NOT LIKE', $keyword); + $q1->whereNotLike('transaction_journals.description', $keyword); } } ); @@ -387,7 +387,7 @@ class GroupCollector implements GroupCollectorInterface static function (EloquentBuilder $q2) use ($array): void { foreach ($array as $word) { $keyword = sprintf('%%%s%%', $word); - $q2->where('transaction_groups.title', 'NOT LIKE', $keyword); + $q2->whereNotLike('transaction_groups.title', $keyword); $q2->orWhereNull('transaction_groups.title'); } }