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

This commit is contained in:
VENKATESHWARAN 2024-10-26 08:50:22 +05:30
commit 34789897c9
2 changed files with 25 additions and 11 deletions

View File

@ -1856,6 +1856,7 @@ class EmployeeRestController extends AdminController
public function iAgreeForAddOn()
{
$postData = json_decode($this->request->getBody(), true);
$client_policy_id = $postData['client_policy_id'];
sort($client_policy_id);
@ -1876,19 +1877,25 @@ class EmployeeRestController extends AdminController
$array_list = [];
foreach ($client_policy_id as $key => $value)
{
foreach ($empData as $empDataKey => $empDataValue)
$policy = $this->clientPolicyModel->where('id',$value)->where('open_for_enrollment',1)->find();
if($policy)
{
$this->employeePolicyModel->where('client_policy_id', $value )
->where('is_active', 1 )
->where('employee_id', $empDataValue['id'] )
->set(array('status'=>'enrolled'))
->update();
foreach ($empData as $empDataKey => $empDataValue)
{
$this->employeePolicyModel->where('client_policy_id', $value )
->where('is_active', 1 )
->where('employee_id', $empDataValue['id'] )
->set(array('status'=>'enrolled'))
->update();
}
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
if(count($find) > 0){
$array_list[] = $find;
}
}
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
if(count($find) > 0){
$array_list[] = $find;
}
}
$notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();

View File

@ -96,7 +96,14 @@ class RestAuthenticationController extends AdminController
$mobile_number = $this->request->getJSON()->mobile_number;
$otp_verification = $this->request->getJSON()->otp_verification;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
if (isset($this->request->getJSON()->login_by_hr))
{
$employeeData = $this->employeeModel->where('id', $this->request->getJSON()->employee_id)->where('relationship', 'self')->first();
}else{
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
}
if ($employeeData && $otp_verification == true || $employeeData && isset($this->request->getJSON()->login_by_hr)) {
$auth = HttpRequestHelper::getRequestInfo();