FIX_FILTER_ISSUE
This commit is contained in:
parent
90660bf4f7
commit
b84be593a5
@ -3308,21 +3308,14 @@ class EmployeeRestController extends AdminController
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$clientPolicy = $this->clientPolicyModel
|
$clientPolicy = $this->clientPolicyModel->where('id',$this->request->getGet('client_policy_id'))->findAll();
|
||||||
->where('id', $this->request->getGet('client_policy_id'))
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
if (!count($clientPolicy ?? [])) {
|
if(count($clientPolicy ?? []) == 0){
|
||||||
return $this->respond([
|
return $this->respond(['status' => 'failed','code' => 404, 'message' => 'Client policy not found', 'data' => [] ], 200);
|
||||||
'status' => 'failed',
|
|
||||||
'code' => 404,
|
|
||||||
'message' => 'Client policy not found',
|
|
||||||
'data' => []
|
|
||||||
], 200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_array($clientPolicy['policy_type_id'], [3,4,5,72])){
|
if(in_array($clientPolicy[0]['policy_type_id'], [3,4,5,72])){
|
||||||
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($clientPolicy['base_policy'], $this->request->getGet('emp_code'));
|
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($clientPolicy[0]['base_policy'], $this->request->getGet('emp_code'));
|
||||||
}else{
|
}else{
|
||||||
$openForEnrollment = $this->findThePolicyIsOpenForEnrollment($this->request->getGet('client_policy_id'), $this->request->getGet('emp_code'));
|
$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'))
|
$empData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
||||||
->where('is_addon_value', 0 )
|
->where('is_addon_value', 0 )
|
||||||
->findAll();
|
->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
|
}else if($clientPolicy[0]['policy_type_id'] == 5)//GMC-Parent-Topup
|
||||||
{
|
{
|
||||||
$empData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
$empData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
||||||
@ -3392,7 +3390,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user