From b3f2fc10db2a0f1622a7b18896baab622a2a55da Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 23 Nov 2017 11:06:14 +0530 Subject: [PATCH] changes in followup screen --- .../application/models/Calltracking_model.php | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 13bca699..ce29f9b6 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -276,10 +276,14 @@ class Calltracking_model extends CI_Model { public function getTrackingFollowup($trackingId=null) { - $this->db->select('InteractionId,TrackingID,FollowupOn,FollowupComments,CreatedOn'); + $this->db->select('LTF.InteractionId,LTF.TrackingID,LTF.FollowupOn,LTF.FollowupComments,DATE_FORMAT(LTF.CreatedOn, "%d-%m-%Y %h:%i %p") AS CreatedOn,ST.FirstName'); + + $this->db->from(LEAD_TRACKING_FOLLOWUP.' as LTF'); + $this->db->join(LOGIN.' as LO', 'LO.ID = LTF.CreatedBy'); + $this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID'); $this->db->where('TrackingID',$trackingId); $this->db->order_by('InteractionId','DESC'); - $trackingDetails = $this->db->get(LEAD_TRACKING_FOLLOWUP); + $trackingDetails = $this->db->get(); return $trackingDetails->result(); } @@ -356,6 +360,8 @@ class Calltracking_model extends CI_Model { $tracking_array["ListCode"]=$row->ListCode; $tracking_array["ListName"]=$row->ListName; $tracking_array["followupDetails"]=$this->getTrackingFollowup($row->TrackingID); + $tracking_array["collectTrackedID"]=$this->getStudentTrackedID($row->MobileNumber); + $result[]=$tracking_array; @@ -375,5 +381,23 @@ class Calltracking_model extends CI_Model { } + /* + * get student tracked id + * @params mobile number + * created by kms + * */ + public function getStudentTrackedID($stuMobile=null) + { + $this->db->distinct(); + $this->db->select('LT.TrackingID,LT.LeadID,PLD.ListCode,PLD.ListName'); + $this->db->from(LEAD_DETAILS.' as LD'); + $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.ActivityStatus'); + $this->db->where('LD.MobileNumber',$stuMobile); + $this->db->order_by('LT.TrackingID','ASC'); + $studeTrackID = $this->db->get(); + return $studeTrackID->result(); + } + } \ No newline at end of file