From 0ca43d5245a191efe79eaf48143bf4ed04b3cb6b Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 18 Nov 2022 12:14:18 +0530 Subject: [PATCH] MIS Report Col Added : ps --- api/application/controllers/SMC_Credit_PD_Controller.php | 6 ++++-- api/application/models/PD_Model.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 19a211f7..74578550 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1179,12 +1179,13 @@ class SMC_Credit_PD_Controller extends REST_Controller { //$SMC_CREDIT_PD = $this->SMC_Credit_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC'); - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno, PDTYPE.type_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.fk_product_id, PRODUCT.abbr, PDTRIGGER.pd_status, PDAPPLICANTSDETAILS.applicant_name, (SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon, (SELECT concat(m_user_profile.first_name," " ,m_user_profile.last_name) FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name,PDTRIGGER.mis_report_remarks,PDTRIGGER.vendor_status'); - + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno, PDTYPE.type_name, PDTRIGGER.lender_applicant_id, PDTRIGGER.fk_product_id, PRODUCT.abbr, PDTRIGGER.pd_status, PDAPPLICANTSDETAILS.applicant_name, (SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon, (SELECT concat(m_user_profile.first_name," " ,m_user_profile.last_name) FROM h_common_masters JOIN m_user_profile on h_common_masters.new_value = m_user_profile.userid where PDTRIGGER.pd_id = primary_key AND field_name = "fk_pd_allocated_to" order by log_id DESC limit 1) as officer_name,PDTRIGGER.mis_report_remarks,PDTRIGGER.vendor_status,PDTRIGGER.fk_city,CITY.name as city_name'); + $this->db->SELECT('(SELECT GROUP_CONCAT(concat(m_user_profile.first_name, " ", m_user_profile.last_name,"(",DATE_FORMAT(h_common_masters.createdon, "%d-%m-%Y %r"),") ")) FROM h_common_masters JOIN m_user_profile on h_common_masters.fk_createdby = m_user_profile.userid where PDTRIGGER.pd_id = h_common_masters.primary_key and field_name = "video_call_initiate_user" order by log_id DESC) as video_call_initiate_user, (SELECT count(log_id) FROM h_common_masters where PDTRIGGER.pd_id = h_common_masters.primary_key and field_name = "video_call_initiate_user") as total_video'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(PRODUCTS.' as PRODUCT','PDTRIGGER.fk_product_id = PRODUCT.product_id','LEFT'); $this->db->JOIN(PDTYPE.' as PDTYPE','PDTRIGGER.fk_pd_type = PDTYPE.pd_type_id','LEFT'); $this->db->JOIN(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS','PDTRIGGER.pd_id = PDAPPLICANTSDETAILS.fk_pd_id and and PDAPPLICANTSDETAILS.applicant_type = 1','LEFT'); + $this->db->JOIN(CITY.' as CITY','PDTRIGGER.fk_city = CITY.city_id','LEFT'); //$this->db->JOIN(COMMONMASTER.' as COMMONMASTER','PDTRIGGER.pd_id = PDAPPLICANTSDETAILS.fk_pd_id and and PDAPPLICANTSDETAILS.applicant_type = 1 and COMMONMASTER.primary_key and COMMONMASTER.table_name = "t_pd_triggered" and COMMONMASTER.field_name = "pd_status" and COMMONMASTER.new_value = "COMPLETED"'); //$this->db->WHERE('PDTRIGGER.pd_status','COMPLETED'); @@ -1209,6 +1210,7 @@ class SMC_Credit_PD_Controller extends REST_Controller { $this->db->ORDER_BY('PDTRIGGER.pd_id DESC'); $SMC_CREDIT_PD = $this->db->GET()->result_array(); + // print_r($this->db->last_query());die(); if(count($SMC_CREDIT_PD)) { $data['dataStatus'] = true; diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 6ee4484a..76b50f4a 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1020,7 +1020,7 @@ class PD_Model extends SPARQ_Model { case 'video_call_initiate_user': $user = $log['createdby']; $time = $log['createdon']; - $log_string = $user." initiated call at ".$time; + $log_string = $user." initiated the call"; $actual_logs[$log_key]['user'] = $user; $actual_logs[$log_key]['time'] = $time; $actual_logs[$log_key]['log'] = $log_string;