diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index b2f844d..2d5a2a7 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2715,8 +2715,12 @@ class EmployeeRestController extends AdminController $array_list = []; foreach ($client_policy_id as $key => $value) { - // $policy = $this->clientPolicyModel->where('id',$value)->where('open_for_enrollment',1)->find(); - $policy = $this->findThePolicyIsOpenForEnrollment($value, $emp_code); + + $clientPolicyData = $this->clientPolicyModel->where('client_id',$client_id) + ->where('id',$value) + ->where('is_active', 1) + ->first(); + $policy = $this->findThePolicyIsOpenForEnrollment($clientPolicyData['base_policy'], $emp_code); if($policy) { $this->myLogger->logme("error", 'client policy id = '.$value.' is open for enrollment');