Commit 21994628 by html5-李恒逸

销管-看到之前信息

parent e7e492a2
...@@ -93,7 +93,8 @@ class Kpiadmin extends CI_Controller ...@@ -93,7 +93,8 @@ class Kpiadmin extends CI_Controller
//我是销管 //我是销管
$user_id = (int)$this->session->userdata('u_id'); $user_id = (int)$this->session->userdata('u_id');
$where .= ' and R.user_id = ' . $user_id; $buildings_select=$this->manager->get_buildings('id = ' . $user_id);
$where .= ' and B.id in (' . $buildings_select[0]['building_id'].')';
$where = trim($where, ' and '); $where = trim($where, ' and ');
//获取客户总数 //获取客户总数
...@@ -109,7 +110,8 @@ class Kpiadmin extends CI_Controller ...@@ -109,7 +110,8 @@ class Kpiadmin extends CI_Controller
{ {
foreach ($customers as $key => $customer) { foreach ($customers as $key => $customer) {
$customers[$key]['customers'] = 0; $customers[$key]['customers'] = 0;
$where = 'R.user_id =' . $user_id; // $where = 'R.user_id =' . $user_id;
$where = 'B.id in (' . $buildings_select[0]['building_id'].')';
if ($con_arr['start_day']) { if ($con_arr['start_day']) {
$where .= ' and CB.create_time >= ' . strtotime($con_arr['start_day']); $where .= ' and CB.create_time >= ' . strtotime($con_arr['start_day']);
...@@ -205,7 +207,8 @@ class Kpiadmin extends CI_Controller ...@@ -205,7 +207,8 @@ class Kpiadmin extends CI_Controller
if ($info['role_id'] == 10) if ($info['role_id'] == 10)
{ {
$where .= ' and RR.user_id =' . $user_id; $buildings_select=$this->manager->get_buildings('id = ' . $user_id);
$where .= ' and B.id in (' . $buildings_select[0]['building_id'].')';
} else if ($info['role_id'] == 11){ } else if ($info['role_id'] == 11){
$where .= ' and D.manager_id =' . $user_id; $where .= ' and D.manager_id =' . $user_id;
} }
......
...@@ -144,7 +144,7 @@ class Report extends CI_Controller ...@@ -144,7 +144,7 @@ class Report extends CI_Controller
$this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1; $this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1;
$this->data['managers'] = $this->manager->get_manager_name(); $this->data['managers'] = $this->manager->get_manager_name();
$this->load->view('admin/report/index_info',$this->data); $this->load->view('admin/report/index_info',$this->data);
} }
...@@ -820,7 +820,8 @@ class Report extends CI_Controller ...@@ -820,7 +820,8 @@ class Report extends CI_Controller
//$where .= ' B.id in('.$b_id.') and'; //$where .= ' B.id in('.$b_id.') and';
} }
$buildings_select=$this->manager->get_buildings('id = ' . $user_id); $where .= ' B.id in (' . $buildings_select[0]['building_id'].')'; $buildings_select=$this->manager->get_buildings('id = ' . $user_id);
$where .= ' B.id in (' . $buildings_select[0]['building_id'].')';
$where = trim($where,' and '); $where = trim($where,' and ');
return $where; return $where;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment