1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

unify code + fixes

This commit is contained in:
paulwer 2023-01-30 10:46:05 +01:00
parent 8274aadd05
commit 6e9a420bea
6 changed files with 23 additions and 19 deletions

View File

@ -26,12 +26,13 @@ class BankIntegrationFilters extends QueryFilters
*/
public function name(string $name = ''): Builder
{
if(strlen($name) >=1)
return $this->builder->where('bank_account_name', 'like', '%'.$name.'%');
if (strlen($filter) == 0) {
return $this->builder;
}
return $this->builder->where('bank_account_name', 'like', '%'.$name.'%');
}
/**
* Filter based on search text.
*

View File

@ -27,12 +27,13 @@ class BankTransactionFilters extends QueryFilters
*/
public function name(string $name = ''): Builder
{
if(strlen($name) >=1)
return $this->builder->where('bank_account_name', 'like', '%'.$name.'%');
if (strlen($filter) == 0) {
return $this->builder;
}
return $this->builder->where('bank_account_name', 'like', '%'.$name.'%');
}
/**
* Filter based on search text.
*

View File

@ -30,12 +30,13 @@ class BankTransactionRuleFilters extends QueryFilters
*/
public function name(string $name = ''): Builder
{
if(strlen($name) >=1)
return $this->builder->where('name', 'like', '%'.$name.'%');
if (strlen($filter) == 0) {
return $this->builder;
}
return $this->builder->where('name', 'like', '%'.$name.'%');
}
/**
* Filter based on search text.
*

View File

@ -30,12 +30,13 @@ class ClientFilters extends QueryFilters
*/
public function name(string $name = ''): Builder
{
if(strlen($name) >=1)
return $this->builder->where('name', 'like', '%'.$name.'%');
if (strlen($filter) == 0) {
return $this->builder;
}
return $this->builder->where('name', 'like', '%'.$name.'%');
}
/**
* Filter by balance.
*

View File

@ -20,7 +20,7 @@ class SystemLogFilters extends QueryFilters
{
public function type_id(int $type_id): Builder
{
if (isset($event_id) == 0) {
if (isset($event_id)) {
return $this->builder;
}
@ -29,7 +29,7 @@ class SystemLogFilters extends QueryFilters
public function category_id(int $category_id): Builder
{
if (isset($event_id) == 0) {
if (isset($event_id)) {
return $this->builder;
}
@ -38,7 +38,7 @@ class SystemLogFilters extends QueryFilters
public function event_id(int $event_id): Builder
{
if (isset($event_id) == 0) {
if (isset($event_id)) {
return $this->builder;
}
@ -54,7 +54,7 @@ class SystemLogFilters extends QueryFilters
*/
public function filter(string $filter = ''): Builder
{
if (strlen($filter) == 0) {
if (strlen($filter)) {
return $this->builder;
}