Make sure the attach method works with API properties

This commit is contained in:
Alex Tselegidis 2021-11-06 15:34:35 +01:00
parent 89b9c802a2
commit bd8144f7cb
3 changed files with 5 additions and 5 deletions

View File

@ -491,7 +491,7 @@ class Appointments_model extends EA_Model {
$appointment['service'] = $this
->db
->get_where('services', [
'id' => $appointment['id_services']
'id' => $appointment['id_services'] ?? $appointment['serviceId'] ?? NULL
])
->row_array();
break;
@ -500,7 +500,7 @@ class Appointments_model extends EA_Model {
$appointment['provider'] = $this
->db
->get_where('users', [
'id' => $appointment['id_users_provider']
'id' => $appointment['id_users_provider'] ?? $appointment['providerId'] ?? NULL
])
->row_array();
break;
@ -509,7 +509,7 @@ class Appointments_model extends EA_Model {
$appointment['customer'] = $this
->db
->get_where('users', [
'id' => $appointment['id_users_customer']
'id' => $appointment['id_users_customer'] ?? $appointment['customerId'] ?? NULL
])
->row_array();
break;

View File

@ -382,7 +382,7 @@ class Services_model extends EA_Model {
$service['service_category'] = $this
->db
->get_where('service_categories', [
'id' => $service['id_service_categories']
'id' => $service['id_service_categories'] ?? $service['categoryId'] ?? NULL
])
->row_array();
break;

View File

@ -348,7 +348,7 @@ class Unavailabilities_model extends EA_Model {
$unavailability['provider'] = $this
->db
->get_where('users', [
'id' => $unavailability['id_users_provider']
'id' => $unavailability['id_users_provider'] ?? $unavailability['providerId'] ?? NULL
])
->row_array();
break;