CHANGE_ in polict list openForEnrolemnt key and added policy_status key where in where condition : GWM

This commit is contained in:
bitbucket 2024-05-02 10:06:54 +05:30
parent e80d3ac956
commit b4cc2fb2a4
2 changed files with 8 additions and 3 deletions

View File

@ -1039,6 +1039,7 @@ public function getEmployeePolicy()
$keysToRemove = ["removable_keys"];
// Retrieve employee policy data by passing the employee primary key
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
// Retrieve employee and dependents data by passing the employee code
$employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('client_id',$client_id)
->where('is_active', 1 )->where('is_addon_value',0)->findAll();
@ -1062,6 +1063,7 @@ public function getEmployeePolicy()
$array->SlabRates = $getSlabAndGridData['slab_rates'];
$array->GridMaster = $getSlabAndGridData['grid_master'];
// Construct value for policy type GPA
if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){
@ -1268,8 +1270,10 @@ public function getAddOnPolicy()
$GMCEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',0)->findAll();
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll();
// dd($clientPolicy);
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))
->where('policy_status', 1)
->findAll();
if(count($clientPolicy))
{
$PolicyData = [];
@ -1286,7 +1290,7 @@ public function getAddOnPolicy()
$responce['client_id'] = $array['client_id'];
$responce['client_policy_id'] = $array['id'];
$responce['is_addon'] = $array['is_addon'];
$responce['open_for_enrollment'] = $array['open_for_enrollment'];
$responce['OpenForEnrollment'] = $array['open_for_enrollment'];
$responce['policy_terms'] = $decodedArray;
if(count($getSlabAndGridData['slab_rates'])){

View File

@ -135,6 +135,7 @@ class EmployeeModel extends Model
->select(' policies.name as Policy_Name , client_policy.policy_terms as Policy_Terms, client_policy.client_id as ClientId, client_policy.policy_id as PolicyId,client_policy.id as ClientPolicyId, client_policy.open_for_enrollment as OpenForEnrollment') // Select all columns from both tables
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
->join('policies', 'policies.id = client_policy.policy_id')
->where('client_policy.policy_status', 1)
->where('employee_polices.employee_id', $id)
->get()
->getResult();