Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
vadivelJ96 2025-11-05 09:53:54 +05:30
commit a74154282d
5 changed files with 56 additions and 23 deletions

View File

@ -501,12 +501,16 @@ $routes->cli('cli/sendMailWithAutoQuery','TicketController::sendMailWithAutoQuer
//Employee login api's
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationController::verifyEmployeeWithEmailId");
$routes->post("/employeeRest/updateEmpOTP", "RestAuthenticationController::updateEmpOTP");
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("/employeeRest/updateEmpMPIN", "RestAuthenticationController::updateEmpMPIN");
$routes->post("employeeRest/forgotMPIN", "RestAuthenticationController::forgotMPIN");
$routes->post("employeeRest/updateMobileNumber", "RestAuthenticationController::updateMobileNumber");
// $routes->post("/employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
@ -530,8 +534,6 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
});
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("employeeRest/getPostEmployeeDataForAuth", "RestAuthenticationController::getPostEmployeeDataForAuth");
// $routes->post("logHrActivity", "RestAuthenticationController::logHrActivity");

View File

@ -2831,7 +2831,7 @@ class EmployeeRestController extends AdminController
->where('client_policy.client_branch_id', $this->request->getGet('client_branch_id') )
->where('client_policy.is_active', 1 )
->where('client_policy.policy_status', $policy_status)
->where('client_policy.enrolment_visibility', 1 )
->where('client_policy.enrolment_visibility', 1)
->orderby('client_policy.id' , 'ASC')
->findAll();
@ -2840,16 +2840,25 @@ class EmployeeRestController extends AdminController
->where('client_id',$this->request->getGet('client_id'))
->where('client_branch_id',$this->request->getGet('client_branch_id'))
->where('is_active', 1 )->findAll();
$employeeName = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
$employeeSelfData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
->where('client_id',$this->request->getGet('client_id'))
->where('client_branch_id',$this->request->getGet('client_branch_id'))
->where('family_floater_key','self')->where('is_active', 1 )
->get()->getRow()->name;
->get()->getRow();
$employeeName = $employeeSelfData->name ?? "";
//for get the pre enrollment policy count
$empMobileNo = $this->request->getGet('mobile_no');
$clientId = $this->request->getGet('client_id');
$prePolicyCount = $this->getPreEmployeePolicyCount($empMobileNo, $clientId);
if(!empty($employeeSelfData) && isset($employeeSelfData->email_corporate)){
$prePolicyCount = $this->getPreEmployeePolicyCount($empMobileNo, $clientId, $employeeSelfData->email_corporate);
}else{
$prePolicyCount = $this->getPreEmployeePolicyCount($empMobileNo, $clientId);
}
$whereArrayForId = [];
foreach ( $employeeData as $key => $value) { array_push($whereArrayForId, $value['id']); }
@ -2972,7 +2981,11 @@ class EmployeeRestController extends AdminController
function policyTermsFiter($terms , $type)
{
{
if(empty($terms)){
return [];
}
$gpa = [
"sumInsured2" => "Sum Insured",
"totalSumInsured" => "Total Sum Assured",
@ -4082,18 +4095,19 @@ class EmployeeRestController extends AdminController
// }
// }
public function getPreEmployeePolicyCount($mobile_no, $clientId = null)
{
log_message('error', 'STEP 1: getPreEmployeePolicyCount called with params: ' . json_encode(['mobile_no' => $mobile_no, 'client_id' => $clientId]));
public function getPreEmployeePolicyCount($mobile_no, $clientId = null, $email = null)
{
log_message('error', 'STEP 1: getPreEmployeePolicyCount called with params: ' . json_encode(['mobile_no' => $mobile_no, 'client_id' => $clientId, 'email' => $email]));
if (empty($mobile_no)) {
log_message('error', 'STEP 2: Mobile number is empty or null. Returning 0.');
if (empty($mobile_no) && empty($email)) {
log_message('error', 'STEP 2: Mobile number and Email is empty or null. Returning 0.');
return 0;
}
$client_short_name = null;
if (!empty($clientId)) {
log_message('error', 'STEP 3: Fetching client short name for client ID: ' . $clientId);
$client_data = $this->clientModel->where('is_active', 1)->where('id', $clientId)->first();
@ -4103,14 +4117,25 @@ class EmployeeRestController extends AdminController
} else {
log_message('error', 'STEP 4: No client found for ID: ' . $clientId);
}
} else {
log_message('error', 'STEP 3: No clientId provided. Skipping client lookup.');
}
$post_data = [
'mobile_number' => $mobile_no,
'client_short_name' => $client_short_name
];
if(!empty($email)){
$post_data = [
'email_id' => $email,
'client_short_name' => $client_short_name
];
}else{
$post_data = [
'mobile_number' => $mobile_no,
'client_short_name' => $client_short_name
];
}
log_message('error', 'STEP 5: Calling third-party API with payload: ' . json_encode($post_data));

View File

@ -1514,9 +1514,9 @@ class EmployeeServiceController extends AdminController
->where('employees.client_id',$file['client_id'])
->where('employees.client_branch_id',$file['client_branch_id'])
->where('employee_polices.client_policy_id',$file['policy_id'])
->where('employees.emp_status !=','truncated')
->where('employees.emp_status','active')
->where('employees.is_active', 1)
->where('employee_polices.status !=','truncated')
->where('employee_polices.status','active')
->where('employee_polices.is_active', 1)
->first();
@ -1550,7 +1550,7 @@ class EmployeeServiceController extends AdminController
$employee_policy = $this->employeePolicyModel
->where('employee_id',$employee['id'])
->where('client_policy_id',$file['policy_id'])
->where('status !=','truncated')
->where('status','active')
->where('is_active', 1)
->first();

View File

@ -344,10 +344,15 @@ class LeadsController extends BaseController
$where = [];
foreach ($search_data as $search_objects => $key) {
if ($key != null && $key != '' && $key != 0 && $search_objects != 'is_dashboard') {
$where[$search_objects] = $key;
if($search_objects == 'status')
{
$where[('leads.'.$search_objects)] = $key;
}else{
$where[$search_objects] = $key;
}
}
}
// !dd($where);
$data['lead_data_list'] = $this->leadsModel->getLeadDataForLising($where);
$html = view('leads_list', $data);

View File

@ -382,6 +382,7 @@ class EmployeePolicyModel extends Model
{
return $this->where('employee_id',$arr['employee_id'])
->where('client_policy_id',$arr['client_policy_id'])
->where('status', 'active')
->where('is_active',1)
->find();
}