CHANGE : active policy check in login api

This commit is contained in:
Gowtham M 2025-02-27 15:27:12 +05:30
parent 5c3d928c24
commit c75cedac0c

View File

@ -71,13 +71,20 @@ class RestAuthenticationController extends AdminController
$mobile_number = $this->request->getJSON()->mobile_number;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)
->where('relationship', 'self')
->where('emp_status !=', 'truncated')
->where('is_active', 1)
->first();
$employeeData = $this->employeeModel->select('employees.relationship,EP.employee_id')
->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner')
->where('employees.is_active', 1)
->where('employees.relationship', 'self')
->where('employees.emp_status !=', 'truncated')
->where('employees.mobile', $mobile_number)
->where('EP.is_active', 1)
->whereIn('EP.status', ['active'])
->first();
if ($employeeData) {
if (isset($employeeData['employee_id']))
{
$result = ['user_verification' => true ,'message' => "Verified Successfully"];
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
@ -97,11 +104,18 @@ class RestAuthenticationController extends AdminController
$email = $this->request->getJSON()->email;
$employeeData = $this->employeeModel->where('email_corporate', $email)->where('relationship', 'self')
->where('emp_status !=', 'truncated')->where('is_active', 1)
$employeeData = $this->employeeModel->select('employees.relationship,EP.employee_id')
->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner')
->where('employees.is_active', 1)
->where('employees.relationship', 'self')
->where('employees.emp_status !=', 'truncated')
->where('employees.email_corporate', $email)
->where('EP.is_active', 1)
->whereIn('EP.status', ['active'])
->first();
if ($employeeData) {
if (isset($employeeData['employee_id']))
{
$otp = random_int(100000, 999999);