diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index ce29f9b6..9bb82924 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -398,6 +398,47 @@ class Calltracking_model extends CI_Model { $studeTrackID = $this->db->get(); return $studeTrackID->result(); } + /* + * used to get dash board call track details + * created by kms + * */ + public function getDashboardTrackingDetails($serach=null) + { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $todayFollowupDate=$now->format('d-m-Y'); + $follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,'S001'); + if($follouwpDetails){ + $result_array['todayStatus']=true; + $result_array['todayFolloupDetails']=$follouwpDetails; + } + else{ + $result_array['todayStatus']=false; + $result_array['todayFolloupDetails']=""; + } + /* $follouwpPendingDetails=$this->getPendingFollowupDetails($todayFollowupDate,'S001'); +print_r($follouwpPendingDetails);die();*/ + return $result_array; + + } + /* + * get date wise followup details + * @params date and status and check status + * */ + public function todayFollowupDetails($todayDate=null,$status=null) + { + $this->db->distinct(); + $this->db->select('LD.LeadName,LD.MobileNumber,LT.TrackingID,LT.LeadID,PLD.ListCode,PLD.ListName,LTF.FollowupOn,LT.StatusCode,PLD1.ListName as statusListName'); + $this->db->from(LEAD_DETAILS.' as LD'); + $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); + $this->db->join(LEAD_TRACKING_FOLLOWUP.' as LTF', 'LTF.TrackingID = LT.TrackingID'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.ActivityStatus'); + $this->db->join(PICK_LIST_DETAILS.' as PLD1', 'PLD1.ListCode = LT.StatusCode'); + $this->db->where('LTF.FollowupOn',$todayDate); + $this->db->where('LT.StatusCode',$status); + $this->db->order_by('LT.TrackingID','ASC'); + return $this->db->get()->result(); + } } \ No newline at end of file