diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index bd20bdda..6bedbb31 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -541,11 +541,13 @@ class Calltracking_model extends CI_Model { public function getTrackingFollowup($trackingId=null) { - $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->select('LTF.InteractionId,LTF.TrackingID,LTF.FollowupOn,LTF.FollowupComments,DATE_FORMAT(LTF.CreatedOn, "%d-%m-%Y %h:%i %p") AS CreatedOn,ST.FirstName,ST1.FirstName as AssignedName,PLD.ListName as AssignedStatus'); $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->join(LOGIN.' as LO1', 'LO1.ID = LTF.AssignedStaff','left'); + $this->db->join(STAFF.' as ST1', 'ST1.StaffID = LO1.StaffID','left'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LTF.StatusName','left'); $this->db->where('TrackingID',$trackingId); $this->db->order_by('InteractionId','DESC'); $trackingDetails = $this->db->get();