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

minor clean up in filters

This commit is contained in:
David Bomba 2023-01-25 11:35:03 +11:00
parent a0ac9df5fd
commit a698990c08

View File

@ -39,14 +39,14 @@ class BankIntegrationFilters extends QueryFilters
* @return Builder
* @deprecated
*/
public function filter(string $filter = '') : Builder
public function filter(string $filter = ''): Builder
{
if (strlen($filter) == 0) {
return $this->builder;
}
return $this->builder->where(function ($query) use ($filter) {
$query->where('bank_integrations.bank_account_name', 'like', '%'.$filter.'%');
$query->where('bank_account_name', 'like', '%'.$filter.'%');
});
}
@ -58,7 +58,7 @@ class BankIntegrationFilters extends QueryFilters
* @param string filter
* @return Builder
*/
public function status(string $filter = '') : Builder
public function status(string $filter = ''): Builder
{
if (strlen($filter) == 0) {
return $this->builder;
@ -90,7 +90,7 @@ class BankIntegrationFilters extends QueryFilters
* @param string sort formatted as column|asc
* @return Builder
*/
public function sort(string $sort) : Builder
public function sort(string $sort): Builder
{
$sort_col = explode('|', $sort);
@ -102,9 +102,8 @@ class BankIntegrationFilters extends QueryFilters
*
* @return Illuminate\Database\Query\Builder
*/
public function entityFilter()
public function entityFilter(): Builder
{
//return $this->builder->whereCompanyId(auth()->user()->company()->id);
return $this->builder->company();
}
}