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

Revert for gateway query

This commit is contained in:
David Bomba 2022-02-21 07:51:49 +11:00
parent 291b0c5669
commit ce0bcd494d

View File

@ -70,16 +70,16 @@ class PaymentMethod
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
$this->gateways =
CompanyGateway::with('gateway')
->where('company_id', $this->client->company_id)
$this->gateways = $this->client
->company
->company_gateways
->whereIn('id', $transformed_ids)
->where('is_deleted', false)
->whereNull('deleted_at')
->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
return array_search($model->id, $transformed_ids);// this closure sorts for us
})->get();
});
} else {
@ -105,15 +105,16 @@ class PaymentMethod
$transformed_ids = $this->transformKeys(explode(',', $company_gateways));
$this->gateways = CompanyGateway::with('gateway')
->where('company_id', $this->client->company_id)
$this->gateways = $this->client
->company
->company_gateways
->whereIn('id', $transformed_ids)
->where('is_deleted', false)
->whereNull('deleted_at')
->where('gateway_key', '54faab2ab6e3223dbe848b1686490baa')
->sortby(function ($model) use ($transformed_ids) { //company gateways are sorted in order of priority
return array_search($model->id, $transformed_ids);// this closure sorts for us
})->get();
});
} else {