CHANGE_cash deposit api :GWM
This commit is contained in:
parent
f05bb5d5f7
commit
11ecfce5c4
@ -1423,19 +1423,23 @@ public function iAgreeForAddOn()
|
||||
{
|
||||
|
||||
$emp_code = $this->request->getPost('emp_code');
|
||||
$client_policy_id = $this->request->getPost('client_policy_id');
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
$postData = json_decode($this->request->getBody(), true);
|
||||
$client_policy_id = $postData['client_policy_id'];
|
||||
|
||||
$this->employeeModel->where('emp_code', $emp_code )
|
||||
->where('is_active', 1 )
|
||||
->set(array('emp_status'=>'enrolled'))
|
||||
->update();
|
||||
foreach ($client_policy_id as $key => $value) {
|
||||
|
||||
$this->employeePolicyModel->where('client_policy_id', $value )
|
||||
->where('is_active', 1 )
|
||||
->set(array('status'=>'enrolled'))
|
||||
->update();
|
||||
|
||||
if (!is_null($client_policy_id) && is_array($client_policy_id))
|
||||
{
|
||||
foreach ($client_policy_id as $key => $value)
|
||||
{
|
||||
$this->employeePolicyModel->where('client_policy_id', $value )
|
||||
->where('is_active', 1 )
|
||||
->set(array('status'=>'enrolled'))
|
||||
->update();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200);
|
||||
@ -1517,6 +1521,39 @@ public function getCashDepositData()
|
||||
$data['insurerName'] = $value['insurer_name'];
|
||||
$data['depositData'] = $this->clientPolicyModel->getdepositData($value['clientId'],$value['insurerId']);
|
||||
$data['balance'] = count($data['depositData']) ? $data['depositData'][0]->balance : 0;
|
||||
|
||||
$data['policyDetails'] = [];
|
||||
$ClientPolicyData =$this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, policies.id as policy_id,policies.policy_type_id as policy_type_id, policies.name as policy_name , client_policy.is_addon as is_addon')
|
||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||
->where('client_policy.insurer_id', $value['insurerId'] )
|
||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||
->findAll();
|
||||
foreach ($ClientPolicyData as $key => $value)
|
||||
{
|
||||
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard( $value['client_policy_id'],$value['client_id']);
|
||||
if($value['is_addon'] == "2"){ $value['type'] = 'SI TopUp'; }else if($value['is_addon'] == "3"){ $value['type'] = 'Dependent AddOn'; }else{ $value['type'] = $getSlabAndGridData['grid_master']['policy_type']; }
|
||||
$employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0);
|
||||
$enrolledCount = 0;
|
||||
$draftCount = 0;
|
||||
if(count($employeeDetails))
|
||||
{
|
||||
foreach ($employeeDetails as $item) {
|
||||
if ($item['emp_status'] === 'enrolled') {
|
||||
$enrolledCount++;
|
||||
} elseif ($item['emp_status'] === 'draft') {
|
||||
$draftCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$value['totalMembersCount'] = count($employeeDetails);
|
||||
$value['membersCountOfEnrolled'] = $enrolledCount;
|
||||
$value['membersCountOfDraft'] = $draftCount;
|
||||
|
||||
array_push($data['policyDetails'],$value);
|
||||
}
|
||||
|
||||
|
||||
array_push($result,$data);
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user