|
@@ -705,7 +705,7 @@ class Home extends Base_Controller {
|
|
|
$where = array();
|
|
|
$proId = intval($this->input->post('proId',true));
|
|
|
|
|
|
- if (!empty($proId)) $where['G2.pid'] = $proId;
|
|
|
+ if (!empty($proId)) $where['G2.id'] = $proId;
|
|
|
if ($role != SYSTEM_ADMIN) $where['P.company'] = $company;
|
|
|
$join = array();
|
|
|
|
|
@@ -714,4 +714,20 @@ class Home extends Base_Controller {
|
|
|
$list = $this->Project_model->get_list_by_join($where, 'G2.id,G2.english_name as name,sum(P.lampcount) as lampcount',NULL, NULL, $join, NULL, 'G2.id', 'P');
|
|
|
exit(json_result('0000',$this->response['0000'],array('list'=>$list)));
|
|
|
}
|
|
|
+
|
|
|
+ // 区域设备数量
|
|
|
+ public function area_dev_count(){
|
|
|
+ $role = $this->get_user_info('role');
|
|
|
+ $company = $this->get_user_info('company');
|
|
|
+ $where = array();
|
|
|
+ $cityId = intval($this->input->post('cityId',true));
|
|
|
+
|
|
|
+ if (!empty($cityId)) $where['G1.id'] = $cityId;
|
|
|
+ if ($role != SYSTEM_ADMIN) $where['P.company'] = $company;
|
|
|
+ $join = array();
|
|
|
+
|
|
|
+ $join[] = ['table'=>'global_location as G1','cond'=>'G1.id = P.cityid','type'=>'left'];
|
|
|
+ $list = $this->Project_model->get_list_by_join($where, 'G1.id,G1.english_name as name,sum(P.lampcount) as lampcount',NULL, NULL, $join, NULL, 'G1.id', 'P');
|
|
|
+ exit(json_result('0000',$this->response['0000'],array('list'=>$list)));
|
|
|
+ }
|
|
|
}
|