|
@@ -23,7 +23,7 @@ class Map extends Base_Controller{
|
|
|
public function get(){
|
|
|
$role = $this->get_user_info('role');
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
$keyword = $this->input->post('keyword',true);
|
|
|
$type = $this->input->post('type',true);
|
|
|
$lampid = $this->input->post('lampid',true);
|
|
@@ -98,7 +98,7 @@ class Map extends Base_Controller{
|
|
|
}
|
|
|
if (!empty($type)) {
|
|
|
if ($type == 5) {
|
|
|
- $data = $this->Videomonitor_model->get_data_by_location($role,$companyid,$projectid,$userid,'id,longitude,latitude,image',$filter);
|
|
|
+ $data = $this->Videomonitor_model->get_data_by_location($role,0,$projectid,$userid,'id,longitude,latitude,image',$filter);
|
|
|
foreach ($data as &$s) {
|
|
|
$s['image'] = base_url($s['image']);
|
|
|
$s['is_video'] = 1;
|
|
@@ -106,17 +106,17 @@ class Map extends Base_Controller{
|
|
|
$s['is_marker'] = 0;
|
|
|
}
|
|
|
}else{
|
|
|
- $data = $this->Lamp_model->get_list_by_role($role,$companyid,$projectid,$userid,$fields,$filter,0,1);
|
|
|
+ $data = $this->Lamp_model->get_list_by_role($role,0,$projectid,$userid,$fields,$filter,0,1);
|
|
|
}
|
|
|
}else{
|
|
|
- $videoData = $this->Videomonitor_model->get_data_by_location($role,$companyid,$projectid,$userid,'id,longitude,latitude,image',$filter);
|
|
|
+ $videoData = $this->Videomonitor_model->get_data_by_location($role,0,$projectid,$userid,'id,longitude,latitude,image',$filter);
|
|
|
foreach ($videoData as &$s) {
|
|
|
$s['image'] = base_url($s['image']);
|
|
|
$s['is_video'] = 1;
|
|
|
$s['is_lamp'] = 0;
|
|
|
$s['is_marker'] = 0;
|
|
|
}
|
|
|
- $lampData = $this->Lamp_model->get_list_by_role($role,$companyid,$projectid,$userid,$fields,$filter,0,1);
|
|
|
+ $lampData = $this->Lamp_model->get_list_by_role($role,0,$projectid,$userid,$fields,$filter,0,1);
|
|
|
$data = array_merge($videoData,$lampData);
|
|
|
}
|
|
|
if ($multiple <= 16 && isset($lng_low) && isset($lng_high) && isset($lat_low) && isset($lat_high)) {
|
|
@@ -295,11 +295,11 @@ class Map extends Base_Controller{
|
|
|
public function video_list(){
|
|
|
$role = $this->get_user_info('role');
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
$projectid = $this->input->post('project_id',true);
|
|
|
$keyword = $this->input->post('keyword',true);
|
|
|
|
|
|
- $videoData = $this->Videomonitor_model->get_one_by_role($role,$companyid,$projectid,$userid,'id,longitude,latitude',$keyword);
|
|
|
+ $videoData = $this->Videomonitor_model->get_one_by_role($role,0,$projectid,$userid,'id,longitude,latitude',$keyword);
|
|
|
$videoData = empty($videoData) ? array() : array($videoData);
|
|
|
exit(json_result('0000',$this->response['0000'],array('list'=>$videoData)));
|
|
|
}
|
|
@@ -308,7 +308,7 @@ class Map extends Base_Controller{
|
|
|
public function lamp_list(){
|
|
|
$role = $this->get_user_info('role');
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
$keyword = $this->input->post('keyword',true);
|
|
|
$section = $this->input->post('section',true);
|
|
|
$type = $this->input->post('type',true);
|
|
@@ -362,10 +362,10 @@ class Map extends Base_Controller{
|
|
|
// break;
|
|
|
default:break;
|
|
|
}
|
|
|
- $data = $this->Lamp_model->get_list_by_role($role,$companyid,$projectid,$userid,$fields,$filter);
|
|
|
+ $data = $this->Lamp_model->get_list_by_role($role,0,$projectid,$userid,$fields,$filter);
|
|
|
unset($filter['page']);
|
|
|
unset($filter['count']);
|
|
|
- $total = $this->Lamp_model->get_list_by_role($role,$companyid,$projectid,$userid,'L.id',$filter,1);
|
|
|
+ $total = $this->Lamp_model->get_list_by_role($role,0,$projectid,$userid,'L.id',$filter,1);
|
|
|
$temp = array();
|
|
|
foreach ($data as $v) {
|
|
|
if (!empty($type) && $type != 3 && isset($v['lampstatus']) && $v['lampstatus'] == 0) {
|
|
@@ -470,7 +470,7 @@ class Map extends Base_Controller{
|
|
|
$project_id = $this->input->post('project_id',true);
|
|
|
$role = $this->get_user_info('role');
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
|
|
|
if (empty($lamp_id) && empty($project_id) || ($lamp_id < 0 && $project_id < 0)) {
|
|
|
exit(json_result('0007',$this->response['0007'],array()));
|
|
@@ -487,7 +487,7 @@ class Map extends Base_Controller{
|
|
|
$data['monthgeneration'] = empty($data['monthgeneration']) ? 0 : round($data['monthgeneration'],1);
|
|
|
$data['yeargeneration'] = empty($data['yeargeneration']) ? 0 : round($data['yeargeneration'],1);
|
|
|
$data['group_count'] = $this->Group_model->get_count_by_filter(array('projectid'=>$project_id));
|
|
|
- $data['fault_count'] = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, $companyid, $userid);
|
|
|
+ $data['fault_count'] = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, 0, $userid);
|
|
|
// $data['install_num'] = $this->Lamp_model->getTotal(array('projectid'=>$project_id), $role, $companyid, $userid);
|
|
|
$data['network_num'] = $this->Network_model->getTotalByProject($project_id);
|
|
|
// var_dump(microtime());
|
|
@@ -502,7 +502,7 @@ class Map extends Base_Controller{
|
|
|
$data['monthgeneration'] = empty($data['monthgeneration']) ? 0 : round($data['monthgeneration'],1);
|
|
|
$data['yeargeneration'] = empty($data['yeargeneration']) ? 0 : round($data['yeargeneration'],1);
|
|
|
$data['group_count'] = $this->Group_model->get_count_by_filter(array('projectid'=>$data['id']));
|
|
|
- $data['fault_count'] = $this->Lamp_model->get_fault_count(array('L.projectid'=>$data['id'],'L.isfaulted'=>1), $role, $companyid, $userid);
|
|
|
+ $data['fault_count'] = $this->Lamp_model->get_fault_count(array('L.projectid'=>$data['id'],'L.isfaulted'=>1), $role, 0, $userid);
|
|
|
// $data['install_num'] = $this->Lamp_model->getTotal(array('projectid'=>$data['id']), $role, $companyid, $userid);
|
|
|
$data['network_num'] = $this->Network_model->getTotalByProject($project_id);
|
|
|
|
|
@@ -513,7 +513,7 @@ class Map extends Base_Controller{
|
|
|
|
|
|
// 获取项目列表
|
|
|
public function project_list() {
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
$role = $this->get_user_info('role');
|
|
|
$userid = $this->get_user_info('id');
|
|
|
|
|
@@ -526,12 +526,12 @@ class Map extends Base_Controller{
|
|
|
$filter = array();
|
|
|
if(!empty($page)) $filter['page'] = $page;
|
|
|
if(!empty($count)) $filter['count'] = $count;
|
|
|
- $data = $this->Project_model->getMultiData($filter, 'P.id, P.projectname as name, P.lampcount,Z.name as zone,S.name as province,P.projectid as number,P.company as companyid', $role, $companyid, $userid);
|
|
|
+ $data = $this->Project_model->getMultiData($filter, 'P.id, P.projectname as name, P.lampcount,Z.name as zone,S.name as province,P.projectid as number,P.company as companyid', $role, 0, $userid);
|
|
|
unset($filter['page']);
|
|
|
unset($filter['count']);
|
|
|
- $total = $this->Project_model->getTotal($filter, $role, $companyid, $userid);
|
|
|
+ $total = $this->Project_model->getTotal($filter, $role, 0, $userid);
|
|
|
$projectIds = array_column($data, 'id');
|
|
|
- $lampData = $this->Lamp_model->get_lamp_count_by_project($projectIds, $role, $companyid, $userid);
|
|
|
+ $lampData = $this->Lamp_model->get_lamp_count_by_project($projectIds, $role, 0, $userid);
|
|
|
|
|
|
$temp = array();
|
|
|
foreach ($lampData as $value) {
|
|
@@ -559,10 +559,10 @@ class Map extends Base_Controller{
|
|
|
$type = intval($this->input->post('type',true));
|
|
|
$mode = intval($this->input->post('mode',true));
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
|
|
|
if (empty($projectid)) {
|
|
|
- $projectid = $this->Project_model->get_projectid_by_role($role,$userid,$companyid);
|
|
|
+ $projectid = $this->Project_model->get_projectid_by_role($role,$userid,0);
|
|
|
$projectid = empty($projectid) ? '0' : $projectid;
|
|
|
}
|
|
|
|
|
@@ -658,15 +658,15 @@ class Map extends Base_Controller{
|
|
|
// 地图页概览数据
|
|
|
public function date_nav(){
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
$role = $this->get_user_info('role');
|
|
|
$project_id = intval($this->input->post('project_id', true));
|
|
|
|
|
|
- $arr = $this->Lamp_model->getTotalLampInfo($role, $companyid, $project_id, $userid,1);
|
|
|
+ $arr = $this->Lamp_model->getTotalLampInfo($role, 0, $project_id, $userid,1);
|
|
|
if (!empty($arr['num'])) {
|
|
|
- $online_arr = $this->Lamp_model->getOnlineCount($role, $companyid, $project_id, $userid, 1);
|
|
|
- $lighting_arr = $this->Lamp_model->getCountByFilter($role, $companyid, $project_id, $userid, array('L.status'=>1));
|
|
|
- $failure = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, $companyid, $userid);
|
|
|
+ $online_arr = $this->Lamp_model->getOnlineCount($role, 0, $project_id, $userid, 1);
|
|
|
+ $lighting_arr = $this->Lamp_model->getCountByFilter($role, 0, $project_id, $userid, array('L.status'=>1));
|
|
|
+ $failure = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, 0, $userid);
|
|
|
|
|
|
$data['online_rate'] = round($online_arr['num']/$arr['num']*100, 2);
|
|
|
$data['lighting_rate'] = round($lighting_arr['num']/$arr['num']*100, 2);
|
|
@@ -896,15 +896,15 @@ class Map extends Base_Controller{
|
|
|
$data = $this->Lamp_model->getOne($lampid,$fields);
|
|
|
|
|
|
$userid = $this->get_user_info('id');
|
|
|
- $companyid = $this->get_user_info('companyid');
|
|
|
+ // $companyid = $this->get_user_info('companyid');
|
|
|
$role = $this->get_user_info('role');
|
|
|
$project_id = $data['projectid'];
|
|
|
|
|
|
- $arr = $this->Lamp_model->getTotalLampInfo($role, $companyid, $project_id, $userid,1);
|
|
|
+ $arr = $this->Lamp_model->getTotalLampInfo($role, 0, $project_id, $userid,1);
|
|
|
if (!empty($arr['num'])) {
|
|
|
- $online_arr = $this->Lamp_model->getOnlineCount($role, $companyid, $project_id, $userid, 1);
|
|
|
- $lighting_arr = $this->Lamp_model->getCountByFilter($role, $companyid, $project_id, $userid, array('L.status'=>1));
|
|
|
- $failure = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, $companyid, $userid);
|
|
|
+ $online_arr = $this->Lamp_model->getOnlineCount($role, 0, $project_id, $userid, 1);
|
|
|
+ $lighting_arr = $this->Lamp_model->getCountByFilter($role, 0, $project_id, $userid, array('L.status'=>1));
|
|
|
+ $failure = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, 0, $userid);
|
|
|
$data['online_rate'] = round($online_arr['num']/$arr['num']*100, 2);
|
|
|
$data['lighting_rate'] = round($lighting_arr['num']/$arr['num']*100, 2);
|
|
|
$data['online_count'] = intval($online_arr['num']);
|