Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d2a5155d70
@ -369,7 +369,7 @@ class EmployeeRestController extends AdminController
|
|||||||
$basic_cover_si = $policy_terms->sum_insured;
|
$basic_cover_si = $policy_terms->sum_insured;
|
||||||
}
|
}
|
||||||
|
|
||||||
$checkDataExist = $this->employeePolicyModel->where('employee_id',$employee_id)->where('client_policy_id',$client_policy_id)->first();
|
$checkDataExist = $this->employeePolicyModel->where('employee_id',$employee_id)->where('client_policy_id',$client_policy_id)->where('is_active', 1)->first();
|
||||||
|
|
||||||
if($checkDataExist){
|
if($checkDataExist){
|
||||||
|
|
||||||
@ -1515,11 +1515,11 @@ class EmployeeRestController extends AdminController
|
|||||||
public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id,$client_branch_id)
|
public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id,$client_branch_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$employeeData = $this->employeeModel->where('emp_code',$emp_code)
|
// $employeeData = $this->employeeModel->where('emp_code',$emp_code)
|
||||||
->where('client_id',$client_id)
|
// ->where('client_id',$client_id)
|
||||||
->where('client_branch_id',$client_branch_id)
|
// ->where('client_branch_id',$client_branch_id)
|
||||||
->where('is_active', 1 )
|
// ->where('is_active', 1 )
|
||||||
->where('is_addon_value',0)->findAll();
|
// ->where('is_addon_value',0)->findAll();
|
||||||
// return $employeeData;
|
// return $employeeData;
|
||||||
foreach ($GmcParrentsPolicy as $key => $array) {
|
foreach ($GmcParrentsPolicy as $key => $array) {
|
||||||
|
|
||||||
@ -1528,8 +1528,18 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
// Reset employee array
|
// Reset employee array
|
||||||
$empData = $employeeData;
|
// $empData = $employeeData;
|
||||||
|
$empData = $this->employeeModel
|
||||||
|
->select('employees.*')
|
||||||
|
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||||
|
->where('employees.emp_code',$emp_code)
|
||||||
|
->where('employees.client_id',$client_id)
|
||||||
|
->where('employees.client_branch_id',$client_branch_id)
|
||||||
|
->where('employee_polices.client_policy_id',$array->ClientPolicyId)
|
||||||
|
->where('employees.is_active', 1 )
|
||||||
|
->where('employee_polices.is_active', 1 )
|
||||||
|
->where('employees.is_addon_value',0)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
$array->Policy_Terms = json_decode($array->Policy_Terms);
|
$array->Policy_Terms = json_decode($array->Policy_Terms);
|
||||||
|
|
||||||
@ -1543,6 +1553,7 @@ class EmployeeRestController extends AdminController
|
|||||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||||
->where('employees.emp_code',$emp_code)
|
->where('employees.emp_code',$emp_code)
|
||||||
->where('employees.is_active',1)
|
->where('employees.is_active',1)
|
||||||
|
->where('employee_polices.is_active',1)
|
||||||
->where('employee_polices.client_policy_id',$array->ClientPolicyId)
|
->where('employee_polices.client_policy_id',$array->ClientPolicyId)
|
||||||
->get()
|
->get()
|
||||||
->getResult();
|
->getResult();
|
||||||
@ -1659,29 +1670,29 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
// Add family floter buttons placement data for FE validation
|
// Add family floter buttons placement data for FE validation
|
||||||
if(count($floters)){
|
if(count($floters)){
|
||||||
foreach ($floters as $familyFloatesValue) {
|
foreach ($floters as $familyFloatesValue) {
|
||||||
|
|
||||||
$temp2['is_value_exist'] = false;
|
$temp2['is_value_exist'] = false;
|
||||||
$temp2['data']['family_floater_key'] = $familyFloatesValue;
|
$temp2['data']['family_floater_key'] = $familyFloatesValue;
|
||||||
$temp2['data']['relationship'] = ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue)));
|
$temp2['data']['relationship'] = ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue)));
|
||||||
$temp2['data']['client_policy_id'] = $array->ClientPolicyId;
|
$temp2['data']['client_policy_id'] = $array->ClientPolicyId;
|
||||||
$temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue)));
|
$temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue)));
|
||||||
$temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue);
|
$temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue);
|
||||||
$temp2['data']['age_validation'] = $this->getAgeRange($array->Policy_Terms,$familyFloatesValue);
|
$temp2['data']['age_validation'] = $this->getAgeRange($array->Policy_Terms,$familyFloatesValue);
|
||||||
array_push($data,$temp2);
|
array_push($data,$temp2);
|
||||||
|
|
||||||
|
|
||||||
array_push($array->to_be_added_relationship,['relationship'=>$temp2['data']['relationship'],'age_validation'=>$temp2['data']['age_validation']]);
|
array_push($array->to_be_added_relationship,['relationship'=>$temp2['data']['relationship'],'age_validation'=>$temp2['data']['age_validation']]);
|
||||||
$array->to_be_added_relationship = array_values(
|
$array->to_be_added_relationship = array_values(
|
||||||
array_map('unserialize',
|
array_map('unserialize',
|
||||||
array_unique(
|
array_unique(
|
||||||
array_map('serialize', $array->to_be_added_relationship)
|
array_map('serialize', $array->to_be_added_relationship)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$array->relationship = [];
|
$array->relationship = [];
|
||||||
foreach ($array->to_be_added_relationship as $key => $value) {
|
foreach ($array->to_be_added_relationship as $key => $value) {
|
||||||
@ -3681,9 +3692,10 @@ class EmployeeRestController extends AdminController
|
|||||||
->join('employee_polices', 'employees.id = employee_polices.employee_id')
|
->join('employee_polices', 'employees.id = employee_polices.employee_id')
|
||||||
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id')
|
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id')
|
||||||
->where('employees.is_active', 1)
|
->where('employees.is_active', 1)
|
||||||
->whereIn('employees.emp_status', ['draft', 'enrolled'])
|
->whereIn('employees.emp_status', ['draft'])
|
||||||
|
->where('employees.family_floater_key', 'self')
|
||||||
->where('employee_polices.is_active', 1)
|
->where('employee_polices.is_active', 1)
|
||||||
->whereIn('employee_polices.status', ['draft', 'enrolled'])
|
->whereIn('employee_polices.status', ['draft'])
|
||||||
->where('cp.enrolment_visibility', 1)
|
->where('cp.enrolment_visibility', 1)
|
||||||
->where('cp.open_for_enrollment', 1)
|
->where('cp.open_for_enrollment', 1)
|
||||||
->where('cp.policy_status', 1)
|
->where('cp.policy_status', 1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user