clientPolicy = new ClientPolicyModel(); $this->empModel = new EmployeeModel(); $this->empPolicyModel = new EmployeePolicyModel(); $this->claimModel = new TicketMasterModel(); } public function clientPolicyMaster($client_id){ return $this->clientPolicy->select("client_policy.id as policy_ref_no,client_policy.client_branch_id as branch_ref_no,client_branch.branch_code, client_policy.insurer_id as insurer_ref_no,insurers.name as insurer,client_policy.policy_type_id,policy_type.policy_type, client_policy.tpa_id as tpa_ref_no,client_policy.policy_start_date,client_policy.policy_end_date,client_policy.policy_no,client_policy.policy_status") ->join('insurers', 'client_policy.insurer_id = insurers.id and insurers.is_active = 1') ->join('policy_type', 'client_policy.policy_type_id = policy_type.id and policy_type.is_active = 1') ->join('client_branch', 'client_policy.client_branch_id = client_branch.id and client_branch.is_active = 1') ->where('client_policy.is_active', 1) ->where('client_policy.client_id', $client_id) ->get() ->getResultArray(); } public function sendEmpMaster($client_id,$where,$limit,$offset = 0) { return $this->empModel->select("id as ref_no,name,emp_code, relationship,emp_status,mobile,email_corporate, change_event,dob,doj,band,gender") ->where("is_active",1) ->where("client_id", $client_id) ->where($where) ->whereNotIn('emp_status', ['truncated'],) ->orderBy("id") ->limit($limit,$offset) ->get() ->getResultArray(); } public function sendEmpPolicies($emp_id) { return $this->empPolicyModel->select("id as ref_no,client_policy_id as policy_ref_no, tpa_id as tpa_ref_no,uhid as policy_no,pre_existing_alignments,age_band,basic_cover_si,date_coverage, policy_end_date,days,premium,rata_premimum,date_of_exit,reason_for_exit,payable_employee") ->where("employee_id", $emp_id) ->where("is_active", 1) ->whereNotIn("status", ['truncated']) ->orderBy("id") ->get() ->getResultArray(); } public function sendClaimMaster($client_id,$where,$limit,$offset = 0) { return $this->claimModel->select("i.name as insurer,tpa.name as tpa,concat(up.first_name,' ',up.last_name) as acm_name, cs.claim_status,ticket_master.emp_name,ticket_master.insured_name, ticket_master.emp_code,ticket_master.policy_no,ticket_master.ticket_type_id as policy_type, ticket_master.emp_mobile,ticket_master.emp_mail,ticket_master.hospital_name,ticket_master.doa, ticket_master.dod,ticket_master.claim_amount,ticket_master.date_of_join,ticket_master.date_of_incep, ticket_master.date_of_accident,ticket_master.date_of_death, ticket_master.date_of_intimat,ticket_master.claim_number,ticket_master.si_amt, ticket_master.raised_date,ticket_master.registration_date,ticket_master.denial_date, ticket_master.settled_date,ticket_master.denial_reason,ticket_master.approved_amount, ticket_master.utr_details,ticket_master.return_remark,ticket_master.cancel_remark, ticket_master.non_id_reason,ticket_master.head_rejection_reason") ->join("tpa","tpa.id = ticket_master.tpa_id and tpa.is_active = 1") ->join("user_profiles up", "ticket_master.acm_id = up.id and up.is_active = 1") ->join('insurers i', 'ticket_master.insurer_id = i.id and i.is_active = 1') ->join('ticket_claim_status cs', 'ticket_master.claim_status_id = cs.id and cs.is_active = 1') ->where("ticket_master.client_id", $client_id) ->where("ticket_master.is_active", 1) ->where($where) ->orderBy("ticket_master.id") ->limit($limit,$offset) ->get() ->getResultArray(); } }