From 0099fd3d05412df6aaae3f8b763f7e80aa39ea61 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 10:30:10 +0530 Subject: [PATCH] course details changes done --- .../application/models/Calltracking_model.php | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 6583c9f4..508fe3d5 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -409,7 +409,7 @@ class Calltracking_model extends CI_Model { $todayFollowupDate=$now->format('d-m-Y'); $todayDateTime=$now->format('Y-m-d'); - $follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,CLOSE,'1'); + /* $follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,CLOSE,'1'); if($follouwpDetails){ $result_array['todayStatus']=true; $result_array['todayFolloupDetails']=$follouwpDetails; @@ -418,7 +418,7 @@ class Calltracking_model extends CI_Model { $result_array['todayStatus']=false; $result_array['todayFolloupDetails']=""; - } + }*/ $follouwpPendingDetails=$this->todayFollowupDetails($todayFollowupDate,CLOSE,'2'); if($follouwpPendingDetails){ @@ -430,7 +430,7 @@ class Calltracking_model extends CI_Model { $result_array['PendingFolloupDetails']=""; } - $todayLeadDetails=$this->todayFollowupDetails($todayDateTime,OPEN,'3'); + /* $todayLeadDetails=$this->todayFollowupDetails($todayDateTime,OPEN,'3'); if($todayLeadDetails){ $result_array['todayLeadStatus']=true; $result_array['todayLeadDetails']=$todayLeadDetails; @@ -439,7 +439,7 @@ class Calltracking_model extends CI_Model { $result_array['todayLeadStatus']=false; $result_array['todayLeadDetails']=""; - } + }*/ return $result_array; @@ -458,12 +458,15 @@ class Calltracking_model extends CI_Model { if($check!='3'){ $this->db->where('LT.StatusCode !=',$status); } + else if($check=='2'){ + $this->db->where('LT.StatusCode !=',$status); + } else if($check=='3'){ $this->db->like('LD.CreatedOn', $todayDate, 'after'); } $leadDetails=$this->db->get(); - if($leadDetails){ + if($leadDetails->result()){ $result_array = array(); foreach ($leadDetails->result() as $row){ $this->db->select('LTF.TrackingID,LTF.InteractionId'); @@ -487,35 +490,36 @@ class Calltracking_model extends CI_Model { } // check today date based pending followp details else if($check=='2'){ - $this->db->where('LTF.FollowupOn <= ',$todayDate); + // $this->db->where('LTF.FollowupOn >',$todayDate); $this->db->where('LT.StatusCode !=',$status); } else if($check=='3'){ $this->db->like('LD.CreatedOn', $todayDate, 'after'); } $trackDetails=$this->db->get(); - foreach ($trackDetails->result() as $row1) - { - $tracking_array["LeadID"]=$row1->LeadID; - $tracking_array["LeadName"]=$row1->LeadName; - $tracking_array["MobileNumber"]=$row1->MobileNumber; - $tracking_array["TrackingID"]=$row1->TrackingID; - $tracking_array["FollowupOn"]=$row1->FollowupOn; - $tracking_array["StatusCode"]=$row1->StatusCode; - $tracking_array["statusListName"]=$row1->statusListName; - $tracking_array["ListCode"]=$row1->ListCode; - $tracking_array["ListName"]=$row1->ListName; + if($trackDetails->result()){ + foreach ($trackDetails->result() as $row1) + { - $result[]=$tracking_array; - + $tracking_array["LeadID"]=$row1->LeadID; + $tracking_array["LeadName"]=$row1->LeadName; + $tracking_array["MobileNumber"]=$row1->MobileNumber; + $tracking_array["TrackingID"]=$row1->TrackingID; + $tracking_array["FollowupOn"]=$row1->FollowupOn; + $tracking_array["StatusCode"]=$row1->StatusCode; + $tracking_array["statusListName"]=$row1->statusListName; + $tracking_array["ListCode"]=$row1->ListCode; + $tracking_array["ListName"]=$row1->ListName; + $result[]=$tracking_array; + } + $result_array['trackingDetails']=$result; } - } - $result_array['trackingDetails']=$result; + return $result_array; }