From a3de2f228673fa0869dd8019bba130c7a5b30318 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 1 Oct 2018 10:58:11 +0530 Subject: [PATCH] PD QUERY CHANGED --- api/application/models/PD_Model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index d4b74fc6..35056da1 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -12,7 +12,7 @@ class PD_Model extends SPARQ_Model { public function listLessPDDetails($page,$limit,$sort)// $page represents mysql offset { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.pd_date_of_initiation, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.fk_pd_status,PDSTATUS.pd_status_name, PDTRIGGER.pd_specific_clarification, PDTRIGGER.createdon, PDTRIGGER.fk_createdby, PDTRIGGER.updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.pd_date_of_initiation, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.fk_pd_status,PDSTATUS.pd_status_name, PDTRIGGER.pd_specific_clarification, PDTRIGGER.createdon, PDTRIGGER.fk_createdby, PDTRIGGER.updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PDTRIGGER.pincode'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id '); $this->db->JOIN(PRODUCTS.' as PRODUCTS','PDTRIGGER.fk_product_id = PRODUCTS.product_id'); @@ -26,6 +26,8 @@ class PD_Model extends SPARQ_Model { $this->db->JOIN(TEMPLATE.' as TEMPLATE','PDTRIGGER.fk_pd_template_id = TEMPLATE.template_id'); $this->db->JOIN(CUSTOMERSEGMENT.' as CUSTOMERSEGMENT','PDTRIGGER.fk_customer_segment = CUSTOMERSEGMENT.customer_segment_id'); $this->db->JOIN(ENTITY.' as AGENCY','PDTRIGGER.pd_agency_id = AGENCY.entity_id','LEFT'); + $this->db->JOIN(STATE.' as STATE','PDTRIGGER.fk_state = STATE.state_id '); + $this->db->JOIN(CITY.' as CITY','PDTRIGGER.fk_city = CITY.city_id'); $this->db->ORDER_BY('PDTRIGGER.pd_id',$sort); $this->db->LIMIT($limit,$page); $result_array = $this->db->GET()->result_array();