mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 08:54:36 -04:00
Fixes for filtering
This commit is contained in:
parent
b230836056
commit
9e7f269a0e
@ -114,8 +114,16 @@ class ExpenseFilters extends QueryFilters
|
|||||||
*/
|
*/
|
||||||
public function has_invoices(string $value = ''): Builder
|
public function has_invoices(string $value = ''): Builder
|
||||||
{
|
{
|
||||||
if ($value == 'true') {
|
$split = explode(",", $value);
|
||||||
return $this->builder->whereNotNull('invoice_id');
|
|
||||||
|
if (is_array($split) && in_array($split[0], ['client', 'project'])) {
|
||||||
|
|
||||||
|
$search_key = $split[0] == 'client' ? 'client_id' : 'project_id';
|
||||||
|
|
||||||
|
return $this->builder->whereNotNull('invoice_id')
|
||||||
|
->whereHas('invoice', function ($query) use ($search_key, $split){
|
||||||
|
$query->where($search_key, $this->decodePrimaryKey($split[1]));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->builder;
|
return $this->builder;
|
||||||
|
@ -7,7 +7,7 @@ parameters:
|
|||||||
- '#Call to an undefined method .*badMethod\(\)#'
|
- '#Call to an undefined method .*badMethod\(\)#'
|
||||||
- '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#'
|
- '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#'
|
||||||
parallel:
|
parallel:
|
||||||
maximumNumberOfProcesses: 8
|
maximumNumberOfProcesses: 1
|
||||||
level: 4
|
level: 4
|
||||||
paths:
|
paths:
|
||||||
- 'app/'
|
- 'app/'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user