Revert for gateway query
This commit is contained in:
parent
291b0c5669
commit
ce0bcd494d
1 changed files with 8 additions and 7 deletions
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue