diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index a14aac42..cffff6ce 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -487,7 +487,7 @@ class EmployeeRestController extends AdminController { try { $empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0,branch_id:$this->request->getGet('client_branch_id')); - + if ($empData) { return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200); } else { diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 4f9652d9..5d8a2070 100644 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -84,8 +84,8 @@ class EmployeePolicyModel extends Model ->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master ->join('insurers im', 'cp.insurer_id = im.id') //im - insurar master ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurar branch - ->join('tpa tpam', 'cp.tpa_id = tpam.id') //tpam - tpa master - ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id') //tpab - tpa brach + ->join('tpa tpam', 'cp.tpa_id = tpam.id','left') //tpam - tpa master + ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id','left') //tpab - tpa brach ->join('clients cm', 'cp.client_id = cm.id') //cm - client master ->where('emp.client_id',$client_id) ->where('emp.client_branch_id',$branch_id)