From ca0abe663fbee9ffa13dde526c75c874ed1b61ec Mon Sep 17 00:00:00 2001 From: Smart Date: Wed, 23 Oct 2024 14:06:24 +0530 Subject: [PATCH 1/3] CHANGE_ in iAgreeForAddOn : GWM --- app/Controllers/EmployeeRestController.php | 30 ++++++++++++------- .../RestAuthenticationController.php | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index c13eb6ba..0ac4e935 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1856,6 +1856,7 @@ class EmployeeRestController extends AdminController public function iAgreeForAddOn() { + $postData = json_decode($this->request->getBody(), true); $client_policy_id = $postData['client_policy_id']; sort($client_policy_id); @@ -1876,21 +1877,30 @@ class EmployeeRestController extends AdminController $array_list = []; foreach ($client_policy_id as $key => $value) { - foreach ($empData as $empDataKey => $empDataValue) + $policy = $this->clientPolicyModel->where('id',$value)->where('open_for_enrollment',1)->find(); + if($policy) { - $this->employeePolicyModel->where('client_policy_id', $value ) - ->where('is_active', 1 ) - ->where('employee_id', $empDataValue['id'] ) - ->set(array('status'=>'enrolled')) - ->update(); + 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; + } + } - $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; - } } + print_r($array_list); + die; + $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first(); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index d4256270..a33cff95 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -94,7 +94,7 @@ class RestAuthenticationController extends AdminController { try { $mobile_number = $this->request->getJSON()->mobile_number; - $otp_verification = $this->request->getJSON()->otp_verification; + $otp_verification = $this->request->getJSON()->otp; $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); From f68612d90ceaf065d95ba0356c34fdb1d9ada043 Mon Sep 17 00:00:00 2001 From: Smart Date: Wed, 23 Oct 2024 14:10:10 +0530 Subject: [PATCH 2/3] CHANGE_ in iAgreeForAddOn : GWM --- app/Controllers/EmployeeRestController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 0ac4e935..b4359c53 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1898,9 +1898,6 @@ class EmployeeRestController extends AdminController } - print_r($array_list); - die; - $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first(); From 4392468481de0318f7c961473b36939cdf77b325 Mon Sep 17 00:00:00 2001 From: Smart Date: Fri, 25 Oct 2024 11:54:55 +0530 Subject: [PATCH 3/3] CHANGE_ getVerifiedUserData API : GWM --- app/Controllers/RestAuthenticationController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index a33cff95..bed2e473 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -94,9 +94,16 @@ class RestAuthenticationController extends AdminController { try { $mobile_number = $this->request->getJSON()->mobile_number; - $otp_verification = $this->request->getJSON()->otp; + $otp_verification = $this->request->getJSON()->otp_verification; - $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + if (isset($this->request->getJSON()->login_by_hr)) + { + $employeeData = $this->employeeModel->where('id', $this->request->getJSON()->employee_id)->where('relationship', 'self')->first(); + }else{ + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + } + + if ($employeeData && $otp_verification == true || $employeeData && isset($this->request->getJSON()->login_by_hr)) { $auth = HttpRequestHelper::getRequestInfo();