Commit 21994628 by html5-李恒逸

销管-看到之前信息

parent e7e492a2
......@@ -93,7 +93,8 @@ class Kpiadmin extends CI_Controller
//我是销管
$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 ');
//获取客户总数
......@@ -109,7 +110,8 @@ class Kpiadmin extends CI_Controller
{
foreach ($customers as $key => $customer) {
$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']) {
$where .= ' and CB.create_time >= ' . strtotime($con_arr['start_day']);
......@@ -205,7 +207,8 @@ class Kpiadmin extends CI_Controller
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){
$where .= ' and D.manager_id =' . $user_id;
}
......
......@@ -820,7 +820,8 @@ class Report extends CI_Controller
//$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 ');
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