James Cole 2024-10-10 06:32:40 +02:00
parent b41fc43e64
commit 9463285ac9
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
2 changed files with 17 additions and 17 deletions

View File

@ -200,7 +200,7 @@ trait MetaCollection
$this->joinMetaDataTables(); $this->joinMetaDataTables();
$this->query->where('journal_meta.name', '=', 'internal_reference'); $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; return $this;
} }
@ -233,7 +233,7 @@ trait MetaCollection
$this->joinMetaDataTables(); $this->joinMetaDataTables();
$this->query->where('journal_meta.name', '=', 'external_id'); $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; return $this;
} }
@ -245,7 +245,7 @@ trait MetaCollection
$this->joinMetaDataTables(); $this->joinMetaDataTables();
$this->query->where('journal_meta.name', '=', 'external_id'); $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; return $this;
} }
@ -303,7 +303,7 @@ trait MetaCollection
$url = (string)json_encode($url); $url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', trim($url, '"')); $url = str_replace('\\', '\\\\', trim($url, '"'));
$this->query->where('journal_meta.name', '=', 'external_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; return $this;
} }
@ -314,7 +314,7 @@ trait MetaCollection
$url = (string)json_encode($url); $url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', ltrim($url, '"')); $url = str_replace('\\', '\\\\', ltrim($url, '"'));
$this->query->where('journal_meta.name', '=', 'external_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; return $this;
} }
@ -327,7 +327,7 @@ trait MetaCollection
// var_dump($url); // var_dump($url);
$this->query->where('journal_meta.name', '=', 'external_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; return $this;
} }
@ -416,7 +416,7 @@ trait MetaCollection
$this->joinMetaDataTables(); $this->joinMetaDataTables();
$this->query->where('journal_meta.name', '=', 'internal_reference'); $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; return $this;
} }
@ -428,7 +428,7 @@ trait MetaCollection
$this->joinMetaDataTables(); $this->joinMetaDataTables();
$this->query->where('journal_meta.name', '=', 'internal_reference'); $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; return $this;
} }
@ -502,7 +502,7 @@ trait MetaCollection
$this->withNotes(); $this->withNotes();
$this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line $this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line
$q->whereNull('notes.text'); $q->whereNull('notes.text');
$q->orWhere('notes.text', 'NOT LIKE', sprintf('%%%s%%', $value)); $q->orWhereNotLike('notes.text', sprintf('%%%s%%', $value));
}); });
return $this; return $this;
@ -513,7 +513,7 @@ trait MetaCollection
$this->withNotes(); $this->withNotes();
$this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line $this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line
$q->whereNull('notes.text'); $q->whereNull('notes.text');
$q->orWhere('notes.text', 'NOT LIKE', sprintf('%%%s', $value)); $q->orWhereNotLike('notes.text', sprintf('%%%s', $value));
}); });
return $this; return $this;
@ -524,7 +524,7 @@ trait MetaCollection
$this->withNotes(); $this->withNotes();
$this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line $this->query->where(static function (Builder $q) use ($value): void { // @phpstan-ignore-line
$q->whereNull('notes.text'); $q->whereNull('notes.text');
$q->orWhere('notes.text', 'NOT LIKE', sprintf('%s%%', $value)); $q->orWhereNotLike('notes.text', sprintf('%s%%', $value));
}); });
return $this; return $this;

View File

@ -156,7 +156,7 @@ class GroupCollector implements GroupCollectorInterface
static function (EloquentBuilder $q1) use ($array): void { static function (EloquentBuilder $q1) use ($array): void {
foreach ($array as $word) { foreach ($array as $word) {
$keyword = sprintf('%%%s', $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 { static function (EloquentBuilder $q2) use ($array): void {
foreach ($array as $word) { foreach ($array as $word) {
$keyword = sprintf('%%%s', $word); $keyword = sprintf('%%%s', $word);
$q2->where('transaction_groups.title', 'NOT LIKE', $keyword); $q2->whereNotLike('transaction_groups.title', $keyword);
$q2->orWhereNull('transaction_groups.title'); $q2->orWhereNull('transaction_groups.title');
} }
} }
@ -183,7 +183,7 @@ class GroupCollector implements GroupCollectorInterface
static function (EloquentBuilder $q1) use ($array): void { static function (EloquentBuilder $q1) use ($array): void {
foreach ($array as $word) { foreach ($array as $word) {
$keyword = sprintf('%s%%', $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 { static function (EloquentBuilder $q2) use ($array): void {
foreach ($array as $word) { foreach ($array as $word) {
$keyword = sprintf('%s%%', $word); $keyword = sprintf('%s%%', $word);
$q2->where('transaction_groups.title', 'NOT LIKE', $keyword); $q2->whereNotLike('transaction_groups.title', $keyword);
$q2->orWhereNull('transaction_groups.title'); $q2->orWhereNull('transaction_groups.title');
} }
} }
@ -379,7 +379,7 @@ class GroupCollector implements GroupCollectorInterface
static function (EloquentBuilder $q1) use ($array): void { static function (EloquentBuilder $q1) use ($array): void {
foreach ($array as $word) { foreach ($array as $word) {
$keyword = sprintf('%%%s%%', $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 { static function (EloquentBuilder $q2) use ($array): void {
foreach ($array as $word) { foreach ($array as $word) {
$keyword = sprintf('%%%s%%', $word); $keyword = sprintf('%%%s%%', $word);
$q2->where('transaction_groups.title', 'NOT LIKE', $keyword); $q2->whereNotLike('transaction_groups.title', $keyword);
$q2->orWhereNull('transaction_groups.title'); $q2->orWhereNull('transaction_groups.title');
} }
} }