%PDF- %PDF-
Direktori : /home/ugotscom/public_html/dg/application/modules/target/models/ |
Current File : /home/ugotscom/public_html/dg/application/modules/target/models/Sales_model - Copy.php |
<?php class Sales_model extends CI_Model{ public function get_count() { $date = new DateTime("now"); $curr_date = $date->format('Y-m-d '); $this->db->select('*'); $this->db->from('leads'); $this->db->where('DATE(added_date)',$curr_date); $query = $this->db->get(); return $query->num_rows(); } public function hot_leads() { $date = new DateTime("now"); $curr_date = $date->format('Y-m-d '); $this->db->select('*'); $this->db->from('leads'); $this->db->where('DATE(added_date)',$curr_date); $this->db->where('lead_type_id',1); $query = $this->db->get(); return $query->num_rows(); } public function closed_leads() { $date = new DateTime("now"); $curr_date = $date->format('Y-m-d '); $this->db->select('*'); $this->db->from('leads'); $this->db->where('DATE(added_date)',$curr_date); $this->db->where('lead_type_id',4); $query = $this->db->get(); return $query->num_rows(); } public function totalno(){ $date = new DateTime("now"); $curr_date = $date->format('Y-m-d '); $this->db->select('added_by, COUNT(added_by) as total'); $this->db->from('leads'); $this->db->where('DATE(added_date)',$curr_date); $this->db->group_by('added_by'); $this->db->order_by('total', 'desc'); $query = $this->db->get(); $row = $query->result_array(); return $row; } public function closedtotalno(){ $date = new DateTime("now"); $curr_date = $date->format('Y-m-d '); $this->db->select('added_by, COUNT(added_by) as total'); $this->db->from('leads'); $this->db->where('DATE(added_date)',$curr_date); $this->db->where('lead_type_id',4); $this->db->group_by('added_by'); $this->db->order_by('total', 'desc'); $query = $this->db->get(); $row = $query->result_array(); return $row; } public function enquirytotal(){ $date = new DateTime("now"); $curr_date = $date->format('Y-m-d '); $this->db->select('enquiry_source, COUNT(enquiry_source) as total'); $this->db->from('leads'); $this->db->where('DATE(added_date)',$curr_date); $this->db->group_by('enquiry_source'); $this->db->order_by('total', 'desc'); $query = $this->db->get(); $row = $query->result_array(); return $row; } }