From 7e69a77b8afe5a004b3ecbc7ac50d877a84df7d0 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Wed, 17 Jul 2024 17:01:27 +0530 Subject: [PATCH] CHANGE_ in iAgreeForAddOn API status change : GWM --- app/Controllers/EmployeeRestController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 6dcd79c2..1edfc878 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1765,21 +1765,29 @@ public function iAgreeForAddOn() ->where('is_active', 1 ) ->set(array('emp_status'=>'enrolled')) ->update(); + + $empData = $this->employeeModel->where('emp_code', $emp_code )->where('client_id', $client_id ) ->where('is_active', 1 )->findAll(); if (!is_null($client_policy_id) && is_array($client_policy_id)) { $array_list = []; foreach ($client_policy_id as $key => $value) { - $this->employeePolicyModel->where('client_policy_id', $value ) + foreach ($empData as $empDataKey => $empDataValue) + { + $this->employeePolicyModel->where('client_policy_id', $value ) ->where('is_active', 1 ) + ->where('employee_id', $empDataValue['id'] ) ->set(array('status'=>'enrolled')) ->update(); + } + $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']); if(count($find) > 0){ $array_list[] = $find; } } + $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();