From 42dfdc5e762728de272f9833afe13fb0beaad686 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 10 Jul 2025 14:46:14 +0530 Subject: [PATCH] RV --- .../RestAuthenticationController.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 339f353d..abdffbdf 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -210,10 +210,20 @@ class RestAuthenticationController extends AdminController $client_id = $this->request->getJSON()->client_id ?? null; $employee_id = $this->request->getJSON()->employee_id ?? null; + // $builder = $this->employeeModel + // ->where('email_corporate', $email) + // ->where('relationship', 'Self') + // ->where('is_active', 1); + $builder = $this->employeeModel - ->where('email_corporate', $email) - ->where('relationship', 'Self') - ->where('is_active', 1); + ->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner') + ->where('employees.email_corporate', $email) + ->where('employees.relationship', 'Self') + ->where('employees.is_active', 1) + ->whereIn('employees.emp_status', ['active', 'expired']) + ->where('EP.is_active', 1) + ->whereIn('EP.status', ['active', 'expired']); + if (!empty($client_id)) { $builder->where('client_id', $client_id); @@ -225,7 +235,6 @@ class RestAuthenticationController extends AdminController $builder->set(['otp' => $otp])->update(); - return true; } @@ -585,7 +594,7 @@ class RestAuthenticationController extends AdminController if(isset($HRAccessData['allowed_modules'])){ $hrData['0']['allowed_modules'] = json_decode($HRAccessData['allowed_modules'],true)['post']; }else{ $hrData['0']['allowed_modules'] = []; } - + $hrData['0']['token_type'] = 'post'; $result = JWTToken::encode($hrData['0']);