CHANGE_UPDATE_POLICY_TERM_FUNCTION : RV
This commit is contained in:
parent
b0a0c6e02e
commit
e884e93fc6
@ -185,7 +185,7 @@ class ClientController extends AdminController
|
|||||||
->getResultArray();
|
->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
$updated_data = [];
|
$client_policy_ids = [];
|
||||||
foreach ($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
$client_policy_id = $result['id'];
|
$client_policy_id = $result['id'];
|
||||||
$policy_terms = json_decode($result['policy_terms'], true); // true to get associative array
|
$policy_terms = json_decode($result['policy_terms'], true); // true to get associative array
|
||||||
@ -197,7 +197,7 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
if ($parents == 1 && $parents_in_law == 1) {
|
if ($parents == 1 && $parents_in_law == 1) {
|
||||||
|
|
||||||
$updated_data[] = $client_policy_id;
|
$client_policy_ids[] = $client_policy_id;
|
||||||
|
|
||||||
$policy_terms['family_floaters']['parents'] = 0;
|
$policy_terms['family_floaters']['parents'] = 0;
|
||||||
$policy_terms['family_floaters']['parents-in-law'] = 0;
|
$policy_terms['family_floaters']['parents-in-law'] = 0;
|
||||||
@ -215,8 +215,10 @@ class ClientController extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($updated_data) > 0){
|
if(count($client_policy_ids) > 0){
|
||||||
echo 'There are ' . count($updated_data) . ' records to be updated.';
|
echo 'There are ' . count($client_policy_ids) . ' records to be updated.';
|
||||||
|
echo '<br>';
|
||||||
|
dd($client_policy_ids);
|
||||||
}else{
|
}else{
|
||||||
echo 'There is no records to be update.';
|
echo 'There is no records to be update.';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user