GWM : relationship chabges on addONAPI
This commit is contained in:
parent
42a1d53b01
commit
b6b9825fa8
@ -2229,34 +2229,34 @@ class EmployeeRestController extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$array['relationship'] = [];
|
$responce['relationship'] = [];
|
||||||
foreach ($array['to_be_added_relationship'] as $key => $value) {
|
foreach ($array['to_be_added_relationship'] as $key => $value) {
|
||||||
if($value['relationship'] == 'Spouse'){
|
if($value['relationship'] == 'Spouse'){
|
||||||
array_push($array['relationship'],['relationship' => 'Spouse','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'],['relationship' => 'Spouse','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
}else if($value['relationship'] == 'Child'){
|
}else if($value['relationship'] == 'Child'){
|
||||||
array_push($array['relationship'], ['relationship' => 'Son','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Son','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
array_push($array['relationship'], ['relationship' => 'Daughter','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Daughter','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
}else if($value['relationship'] == 'Parent'){
|
}else if($value['relationship'] == 'Parent'){
|
||||||
$Father = array_search('Father',$array['existing_relationship']);
|
$Father = array_search('Father',$array['existing_relationship']);
|
||||||
$Mother = array_search('Mother',$array['existing_relationship']);
|
$Mother = array_search('Mother',$array['existing_relationship']);
|
||||||
if ($Father === false && $Mother === false) {
|
if ($Father === false && $Mother === false) {
|
||||||
array_push($array['relationship'], ['relationship' => 'Father','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Father','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
array_push($array['relationship'], ['relationship' => 'Mother','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Mother','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
}else if ($Father !== false && $Mother === false) {
|
}else if ($Father !== false && $Mother === false) {
|
||||||
array_push($array['relationship'], ['relationship' => 'Mother','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Mother','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
} else if ($Mother !== false && $Father === false) {
|
} else if ($Mother !== false && $Father === false) {
|
||||||
array_push($array['relationship'], ['relationship' => 'Father','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Father','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
}
|
}
|
||||||
}else if($value['relationship'] == 'Parent in law'){
|
}else if($value['relationship'] == 'Parent in law'){
|
||||||
$FatherinLaw = array_search('Father in Law',$array['existing_relationship']);
|
$FatherinLaw = array_search('Father in Law',$array['existing_relationship']);
|
||||||
$MotherinLaw = array_search('Mother in Law',$array['existing_relationship']);
|
$MotherinLaw = array_search('Mother in Law',$array['existing_relationship']);
|
||||||
if ($FatherinLaw === false && $MotherinLaw === false) {
|
if ($FatherinLaw === false && $MotherinLaw === false) {
|
||||||
array_push($array['relationship'], ['relationship' => 'Father in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Father in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
array_push($array['relationship'], ['relationship' => 'Mother in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Mother in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
}else if ($FatherinLaw !== false && $MotherinLaw === false) {
|
}else if ($FatherinLaw !== false && $MotherinLaw === false) {
|
||||||
array_push($array['relationship'], ['relationship' => 'Mother in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Mother in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
} else if ($MotherinLaw !== false && $FatherinLaw === false) {
|
} else if ($MotherinLaw !== false && $FatherinLaw === false) {
|
||||||
array_push($array['relationship'], ['relationship' => 'Father in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
array_push($responce['relationship'], ['relationship' => 'Father in Law','age_validation' => $value['age_validation'],'client_policy_id'=>$array['id']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user