FIX_FILTER_ISSUE

This commit is contained in:
VENKATESHWARAN 2026-04-15 18:34:41 +05:30
parent 90660bf4f7
commit b84be593a5

View File

@ -3308,21 +3308,14 @@ class EmployeeRestController extends AdminController
{
try {
$clientPolicy = $this->clientPolicyModel
->where('id', $this->request->getGet('client_policy_id'))
->findAll();
$clientPolicy = $this->clientPolicyModel->where('id',$this->request->getGet('client_policy_id'))->findAll();
if (!count($clientPolicy ?? [])) {
return $this->respond([
'status' => 'failed',
'code' => 404,
'message' => 'Client policy not found',
'data' => []
], 200);
if(count($clientPolicy ?? []) == 0){
return $this->respond(['status' => 'failed','code' => 404, 'message' => 'Client policy not found', 'data' => [] ], 200);
}
if(in_array($clientPolicy['policy_type_id'], [3,4,5,72])){
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($clientPolicy['base_policy'], $this->request->getGet('emp_code'));
if(in_array($clientPolicy[0]['policy_type_id'], [3,4,5,72])){
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($clientPolicy[0]['base_policy'], $this->request->getGet('emp_code'));
}else{
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($this->request->getGet('client_policy_id'), $this->request->getGet('emp_code'));
}
@ -3339,6 +3332,11 @@ class EmployeeRestController extends AdminController
$empData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
->where('is_addon_value', 0 )
->findAll();
}else if($clientPolicy[0]['policy_type_id'] == 72)//OPD
{
$empData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
->where('is_addon_value', 0)
->findAll();
}else if($clientPolicy[0]['policy_type_id'] == 5)//GMC-Parent-Topup
{
$empData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
@ -3392,7 +3390,7 @@ class EmployeeRestController extends AdminController
} catch (\Exception $e) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 200);
}
}