wzh 5 년 전
부모
커밋
c0a06e4277
2개의 변경된 파일5개의 추가작업 그리고 20개의 파일을 삭제
  1. 4 19
      api/application/controllers/Lampcontrol.php
  2. 1 1
      api/application/controllers/Network.php

+ 4 - 19
api/application/controllers/Lampcontrol.php

@@ -83,9 +83,9 @@ class Lampcontrol extends Base_Controller {
             $data['lamps'] = $this->Lamp_model->get_list_by_join($filter, $fields,$limit, $offset, $join, "L.number ASC", NUll, 'L');
         } else {
             if(empty($fields) || empty($field1)){
-                $fields = 'L.id, L.number, IFNULL(L.status,0) as status, L.isfaulted, L.address, L.lamppower, L.electricSOC, L.battvoltage, L.chargestage, L.logtime as updatetime, L.updatetime as modifytime,L.overtimes,L.boardpower,L.lighteness as light,L.projectid,L.devstatus as online,N.networkname as network_name,N.type as net_type,P.projectname as project_name,L.section,L.protocoltype as lampProtocoltype,L.loadtype,P.timezone as timezoneid,M.iccid';
+                $fields = 'L.id, L.number, IFNULL(L.status,0) as status, L.isfaulted, L.address, L.lamppower, L.electricSOC, L.battvoltage, L.chargestage, L.logtime as updatetime, L.updatetime as modifytime,L.overtimes,L.boardpower,L.lighteness as light,L.projectid,L.devstatus as online,N.networkname as network_name,N.type as net_type,P.projectname as project_name,L.section,L.loadtype,P.timezone as timezoneid,M.iccid';
             }else{
-                $fields .= ",L.id,L.projectid,L.section,L.protocoltype as lampProtocoltype,N.devstatus as net_devstatus,L.loadtype,P.timezone as timezoneid,M.iccid";
+                $fields .= ",L.id,L.projectid,L.section,N.devstatus as net_devstatus,L.loadtype,P.timezone as timezoneid,M.iccid";
             }
 
             $download = intval($this->input->post('download',true));
@@ -162,11 +162,7 @@ class Lampcontrol extends Base_Controller {
                                         if ($a == '电池故障') {
                                             $a = '电池电压异常';
                                         }
-                                        if ($value['lampProtocoltype'] == 1) {
-                                            $temp[] = modbus_alarm_translate($a);
-                                        }else{
-                                            $temp[] = alarm_translate($a);
-                                        }
+                                        $temp[] = alarm_translate($a);
                                     }
                                     $value['isfaulted'] = implode(',', $temp2);
                                 }else{
@@ -186,9 +182,6 @@ class Lampcontrol extends Base_Controller {
                         $value['battvoltage'] = !empty($value['battvoltage']) ? $value['battvoltage'] : "0";
                     }
                     if (array_key_exists('chargestage',$value)) {
-                        if ($value['lampProtocoltype'] == 1) {
-                            $value['chargestage'] = isset($indexArr[intval($value['chargestage'])]) ? $indexArr[intval($value['chargestage'])] : $value['chargestage'];
-                        }
                         $value['chargestage'] = isset($value['chargestage']) ? $chargeStageMap[$value['chargestage']] : $unknown;
                     }
                     if (array_key_exists('battstatus',$value)) {
@@ -317,12 +310,7 @@ class Lampcontrol extends Base_Controller {
                                     if ($a == '电池故障') {
                                         $a = '电池电压异常';
                                     }
-                                    if ($value['lampProtocoltype'] == 1) {
-                                        $temp[] = modbus_alarm_translate($a);
-                                    }else{
-                                        $temp[] = alarm_translate($a);
-                                    }
-                                    
+                                    $temp[] = alarm_translate($a);
                                 }
                                 $value['isfaulted'] = implode(',', $temp);
                             }else{
@@ -343,9 +331,6 @@ class Lampcontrol extends Base_Controller {
                     $value['battvoltage'] = !empty($value['battvoltage']) ? $value['battvoltage'] : "0";
                 }
                 if (array_key_exists('chargestage',$value)) {
-                    if ($value['lampProtocoltype'] == 1) {
-                        $value['chargestage'] = isset($indexArr[intval($value['chargestage'])]) ? $indexArr[intval($value['chargestage'])] : $value['chargestage'];
-                    }
                     $value['chargestage'] = isset($value['chargestage']) && isset($chargeStageMap[$value['chargestage']]) ? $chargeStageMap[$value['chargestage']] : $unknown;
                 }
                 if (array_key_exists('battstatus',$value)) {

+ 1 - 1
api/application/controllers/Network.php

@@ -53,7 +53,7 @@ class Network extends Base_Controller {
             $temp[] = $value;
         }
         if (empty($temp)) {
-            $sectionList = $this->Lamp_model->get_list(array('projectid'=>$project_id,'devicetype'=>1), 'section,count(*) as sum',NULL, NULL, 'section ASC,id DESC', 'section');
+            $sectionList = $this->Lamp_model->get_list(array('projectid'=>$project_id), 'section,count(*) as sum',NULL, NULL, 'section ASC,id DESC', 'section');
             foreach ($sectionList as $s) {
                 if ($s['section'] == '') continue;
                 $temp[] = array(