Reservation Fixes
This commit is contained in:
@ -241,6 +241,11 @@ class Persona extends Ideal\Service
|
||||
}
|
||||
if (!empty($addressData)) {
|
||||
$address = $this->direccionService->add($addressData);
|
||||
foreach ($data as $key => $value) {
|
||||
if (str_starts_with($key, 'address_') or str_starts_with($key, 'direccion_')) {
|
||||
unset($data[$key]);
|
||||
}
|
||||
}
|
||||
$data['direccion_id'] = $address->id;
|
||||
}
|
||||
|
||||
@ -262,29 +267,8 @@ class Persona extends Ideal\Service
|
||||
try {
|
||||
$datos = $this->datosPersonaRepository->fetchByPersona($persona->rut);
|
||||
$this->datosPersonaRepository->edit($datos, $data);
|
||||
} catch (Implement\Exception\EmptyResult) {
|
||||
$datosData = ['persona_rut' => $persona->rut];
|
||||
/*if (isset($data['direccion_id'])) {
|
||||
$datosData['direccion_id'] = $data['direccion_id'];
|
||||
}
|
||||
if (isset($data['email'])) {
|
||||
$datosData['email'] = $data['email'];
|
||||
}
|
||||
if (isset($data['telefono'])) {
|
||||
$datosData['telefono'] = $data['telefono'];
|
||||
}
|
||||
if (isset($data['estado_civil'])) {
|
||||
$datosData['estado_civil'] = $data['estado_civil'];
|
||||
}
|
||||
if (isset($data['fecha_nacimiento'])) {
|
||||
$datosData['fecha_nacimiento'] = $data['fecha_nacimiento'];
|
||||
}
|
||||
if (isset($data['ocupacion'])) {
|
||||
$datosData['ocupacion'] = $data['ocupacion'];
|
||||
}
|
||||
if (isset($data['sexo'])) {
|
||||
$datosData['sexo'] = $data['sexo'];
|
||||
}*/
|
||||
} catch (Implement\Exception\EmptyResult $exception) {
|
||||
$datosData = ['persona_rut' => $persona->rut, ...$data];
|
||||
$datosData = $this->datosPersonaRepository->filterData($datosData);
|
||||
$datos = $this->datosPersonaRepository->create($datosData);
|
||||
try {
|
||||
|
Reference in New Issue
Block a user