diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 38e6600d..2220ddbe 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -1335,7 +1335,7 @@ class Calltracking_model extends CI_Model { public function getaddautocall($lead_Details,$track_Details,$followup_Details,$CreatedBy){ - $this->db->select('LD.LeadID,LTF.InteractionId,LT.TrackingID'); + $this->db->select('LD.LeadID,LT.TrackingID'); $this->db->join('T_PickListDetails PD','PD.ListCode = LT.StatusCode','left'); $this->db->join('T_Lead_Details LD','LD.LeadID = LT.LeadID','left'); $this->db->join('T_Lead_Tracking_Followup LTF','LTF.TrackingID = LT.TrackingID','left'); @@ -1348,15 +1348,15 @@ class Calltracking_model extends CI_Model { $this->db->limit(1); $query = $this->db->get('T_Lead_Tracking LT'); $res = $query->result(); - //print_r($res); + //print_r($res);die; if(!empty($res) != 0){ $lead_Details['UpdatedOn'] = date('Y-m-d H:i:s'); $lead_Details['UpdatedBy'] = $CreatedBy; $track_Details['UpdatedOn'] = date('Y-m-d H:i:s'); $track_Details['UpdatedBy'] = $CreatedBy; - $followup_Details['UpdatedOn'] = date('Y-m-d H:i:s'); - $followup_Details['UpdatedBy'] = $CreatedBy; + $followup_Details['CreatedOn'] = date('Y-m-d H:i:s'); + $followup_Details['CreatedBy'] = $CreatedBy; $this->db->where('LeadID',$res[0]->LeadID); $this->db->update('T_Lead_Details',$lead_Details); @@ -1365,8 +1365,10 @@ class Calltracking_model extends CI_Model { $this->db->where('TrackingID',$res[0]->TrackingID); $this->db->update('T_Lead_Tracking',$track_Details); if($this->db->affected_rows() >0){ - $this->db->where('InteractionId',$res[0]->InteractionId); - $this->db->update('T_Lead_Tracking_Followup',$followup_Details); + $followup_Details['TrackingID'] = $res[0]->TrackingID; + + //$followup_Details['TrackingID']=$this->db->insert_id(); + $this->db->insert(LEAD_TRACKING_FOLLOWUP, $followup_Details); if($this->db->affected_rows() == '1'){ $result['leadStatus'] = true; $result['message'] = "Successfully lead details Updated";