From 7cb5691db86b8f58cea27bf4203e42c6760a682a Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Sat, 5 Oct 2019 16:49:28 +0530 Subject: [PATCH] PDALERTS FOR FINANCIAL INS --- api/application/helpers/pdalerts_helper.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index c4bcbbff..2da6ed17 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -30,10 +30,11 @@ class PDALERTS /*********************************************/ /*******Get PD Master Details*****************/ /*********************************************/ - $CI->db->SELECT("PDTRIGGER.fk_lender_id,ENTITY.short_name,PDTRIGGER.lender_applicant_id,PDTRIGGER.fk_pd_type,PDTRIGGER.pd_status,PDTRIGGER.pd_date_of_initiation,PDTRIGGER.scheduled_on,PDTRIGGER.updatedon,PDTRIGGER.fk_pd_allocated_to,ALLOCATED.email as allocated_email,ALLOCATED.mobile_no as allocated_mobile_no,concat(ALLOCATED.first_name,' ',ALLOCATED.last_name) as pdofficer_name,PDTRIGGER.executive_id,EXECUTIVE.email as executive_email,EXECUTIVE.mobile_no as executive_mobile_no,PDTRIGGER.central_pd_officer_id,CENTRALPDOFFICER.mobile_no as centralpdofficer_mobile_no,CENTRALPDOFFICER.email as centralpdofficer_mail,PDTRIGGER.pd_agency_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,CREATED.fk_entity_type_id,CREATED.email as created_email,PDTRIGGER.pd_contact_person_mail,PDAPPLICANTSDETAILS.applicant_name,PDAPPLICANTSDETAILS.mobile_no as customer_mobile_no,PDTRIGGER.encrypted_url,PDOFFICER.web_token as pdofficer_webtoken,PDOFFICER.mob_token as pdofficer_mobtoken,PDEXECUTIVE.web_token as pdexecutive_webtoken,PDEXECUTIVE.mob_token as pdexecutive_mobtoken,CENTRALPDOFFICERTOKEN.web_token as centralpdofficer_webtoken,CENTRALPDOFFICERTOKEN.mob_token as centralpdofficer_mobtoken,concat(LENDERSALESPERSON.first_name,' ',LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,concat(LENDERCREDITPERSON.first_name,' ',LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,LENDERSALESPERSONTOKEN.web_token as lender_sales_web_token,LENDERSALESPERSONTOKEN.mob_token as lender_sales_mob_token,LENDERCREDITPERSONTOKEN.web_token as lender_credit_web_token,LENDERCREDITPERSONTOKEN.mob_token as lender_credit_mob_token,"); + $CI->db->SELECT("PDTRIGGER.fk_lender_id,ENTITY.short_name,PDTRIGGER.lender_applicant_id,PDTRIGGER.fk_pd_type,PDTRIGGER.pd_status,PDTRIGGER.pd_date_of_initiation,PDTRIGGER.scheduled_on,PDTRIGGER.updatedon,PDTRIGGER.fk_pd_allocated_to,ALLOCATED.email as allocated_email,ALLOCATED.mobile_no as allocated_mobile_no,concat(ALLOCATED.first_name,' ',ALLOCATED.last_name) as pdofficer_name,PDTRIGGER.executive_id,EXECUTIVE.email as executive_email,EXECUTIVE.mobile_no as executive_mobile_no,PDTRIGGER.central_pd_officer_id,CENTRALPDOFFICER.mobile_no as centralpdofficer_mobile_no,CENTRALPDOFFICER.email as centralpdofficer_mail,PDTRIGGER.pd_agency_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,CREATED.fk_entity_type_id,CREATED.email as created_email,PDTRIGGER.pd_contact_person_mail,PDAPPLICANTSDETAILS.applicant_name,PDAPPLICANTSDETAILS.mobile_no as customer_mobile_no,PDTRIGGER.encrypted_url,PDOFFICER.web_token as pdofficer_webtoken,PDOFFICER.mob_token as pdofficer_mobtoken,PDEXECUTIVE.web_token as pdexecutive_webtoken,PDEXECUTIVE.mob_token as pdexecutive_mobtoken,CENTRALPDOFFICERTOKEN.web_token as centralpdofficer_webtoken,CENTRALPDOFFICERTOKEN.mob_token as centralpdofficer_mobtoken,concat(LENDERSALESPERSON.first_name,' ',LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,concat(LENDERCREDITPERSON.first_name,' ',LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,LENDERSALESPERSONTOKEN.web_token as lender_sales_web_token,LENDERSALESPERSONTOKEN.mob_token as lender_sales_mob_token,LENDERCREDITPERSONTOKEN.web_token as lender_credit_web_token,LENDERCREDITPERSONTOKEN.mob_token as lender_credit_mob_token,ENTITYFININSTITUTION.institute_email"); $CI->db->FROM(PDTRIGGER." as PDTRIGGER"); $CI->db->JOIN(USERPROFILE." as CREATED","PDTRIGGER.fk_createdby = CREATED.userid",'LEFT'); $CI->db->JOIN(ENTITY." as ENTITY","PDTRIGGER.fk_lender_id = ENTITY.entity_id",'LEFT'); + $CI->db->JOIN(ENTITYFININSTITUTION." as ENTITYFININSTITUTION","PDTRIGGER.imgc_fin_institute = ENTITYFININSTITUTION.entity_fin_institution_id",'LEFT'); $CI->db->JOIN(USERPROFILE." as ALLOCATED","PDTRIGGER.fk_pd_allocated_to = ALLOCATED.userid",'LEFT'); $CI->db->JOIN(USERPROFILE." as EXECUTIVE","PDTRIGGER.executive_id = EXECUTIVE.userid",'LEFT'); $CI->db->JOIN(USERPROFILE." as CENTRALPDOFFICER","PDTRIGGER.central_pd_officer_id = CENTRALPDOFFICER.userid",'LEFT'); @@ -47,10 +48,10 @@ class PDALERTS $CI->db->JOIN(USERNOTIFICATIONTOKENS." as LENDERCREDITPERSONTOKEN","PDTRIGGER.lender_credit_person = LENDERCREDITPERSONTOKEN.fk_user_id",'LEFT'); $CI->db->WHERE("PDTRIGGER.pd_id",$pdid); $core_details = $CI->db->GET()->result_array(); - // print_r($core_details); + //print_r($core_details); - //die(); + // die(); if(count($core_details)) { $additional_data_for_logs['pd_status'] = $core_details[0]['pd_status']; @@ -149,6 +150,7 @@ class PDALERTS $lender_email = null; $lender_sales_person_email = $core_details[0]['lender_sales_person_email']; $lender_credit_person_email = $core_details[0]['lender_credit_person_email']; + $financial_institude_email = $core_details[0]['institute_email']; if($core_details[0]['fk_entity_type_id'] == 2 ) { @@ -165,11 +167,14 @@ class PDALERTS { // self::sendMail($CI,$lender_email,$msg,$core_details); // currently Mail disabled } - //self::sendMail($CI,$lender_sales_person_email,$msg,$core_details);// currently Mail disabled - //self::sendMail($CI,$lender_credit_person_email,$msg,$core_details);// currently Mail disabled + + if($lender_sales_person_email != null){ self::sendMail($CI,$lender_sales_person_email,$msg,$core_details); } + if($lender_credit_person_email != null){ self::sendMail($CI,$lender_credit_person_email,$msg,$core_details); } + if($financial_institude_email != null){ self::sendMail($CI,$financial_institude_email,$msg,$core_details); }// currently Mail disabled } - + // echo 'afer len mail'; + // die(); /*********************************************/