MS-PDRLKVHCADMG\Administrator 5 éve
szülő
commit
80d51a8a06
1 módosított fájl, 53 hozzáadás és 53 törlés
  1. 53 53
      api/application/controllers/Map.php

+ 53 - 53
api/application/controllers/Map.php

@@ -1062,60 +1062,60 @@ class Map extends Base_Controller{
     	$where['status'] = 1;
     	if (!empty($lampid)) $where['lampid'] = $lampid;
 
-    	$list = $this->Lamp_model->get_list_in(null, array(), 'L.number,L.isfaulted,AI.stralarmtype,AI.updatetime as alarmDate,AI.id as alarmId,L.id as lampId,L.protocoltype as lampProtocoltype,L.section,AI.status as failStatus',$where);
-    	$version = $this->session->userdata('version');
+    	// $list = $this->Lamp_model->get_list_in(null, array(), 'L.number,L.isfaulted,AI.stralarmtype,AI.updatetime as alarmDate,AI.id as alarmId,L.id as lampId,L.protocoltype as lampProtocoltype,L.section,AI.status as failStatus',$where);
+    	// $version = $this->session->userdata('version');
     	$data['list'] = array();
-    	foreach ($list as $value) {
-    		// var_dump($value['stralarmtype']);
-    		// 故障信息处理
-    		// var_dump($value['isfaulted'] == 0 || $value['failStatus'] == 1 || empty($value['stralarmtype']));
-            if ($value['isfaulted'] == 0 || $value['failStatus'] == 1 || empty($value['stralarmtype'])) {
-                if (empty($version)) {
-                    $value['alarmInfo'] = '否';
-                }else{
-                    $value['alarmInfo'] = 'Nothing';
-                } 
-            }else{
-                if (empty($version)) {
-                    $stralarmtype = trim($value['stralarmtype']);
-                    if (!empty($stralarmtype)) {
-                        $alarmArr = explode(',', $stralarmtype);
-                        $temp2 = array();
-                        foreach ($alarmArr as $a) {
-                            if ($a == '电池故障') {
-                                $a = '电池电压异常';
-                            }
-                            $temp2[] = $a;
-                        }
-                        $value['alarmInfo'] = implode(',', $temp2);
-                    }else{
-                        $value['alarmInfo'] = '否';
-                    }
-                }else{
-                    $stralarmtype = trim($value['stralarmtype']);
-                    if (!empty($stralarmtype)) {
-                        $alarmArr = explode(',', $stralarmtype);
-                        $temp2 = array();
-                        foreach ($alarmArr as $a) {
-                            if ($a == '电池故障') {
-                                $a = '电池电压异常';
-                            }
-                            if ($value['lampProtocoltype'] == 1) {
-                                $temp2[] = modbus_alarm_translate($a);
-                            }else{
-                                $temp2[] = alarm_translate($a);
-                            }
-                        }
-                        $value['alarmInfo'] = implode(',', $temp2);
-                    }else{
-                        $value['alarmInfo'] = 'Nothing';
-                    }
-                }
-            }
-            unset($value['failStatus']);
-            unset($value['stralarmtype']);
-            $data['list'][] = $value;
-    	}
+    	// foreach ($list as $value) {
+    	// 	// var_dump($value['stralarmtype']);
+    	// 	// 故障信息处理
+    	// 	// var_dump($value['isfaulted'] == 0 || $value['failStatus'] == 1 || empty($value['stralarmtype']));
+     //        if ($value['isfaulted'] == 0 || $value['failStatus'] == 1 || empty($value['stralarmtype'])) {
+     //            if (empty($version)) {
+     //                $value['alarmInfo'] = '否';
+     //            }else{
+     //                $value['alarmInfo'] = 'Nothing';
+     //            } 
+     //        }else{
+     //            if (empty($version)) {
+     //                $stralarmtype = trim($value['stralarmtype']);
+     //                if (!empty($stralarmtype)) {
+     //                    $alarmArr = explode(',', $stralarmtype);
+     //                    $temp2 = array();
+     //                    foreach ($alarmArr as $a) {
+     //                        if ($a == '电池故障') {
+     //                            $a = '电池电压异常';
+     //                        }
+     //                        $temp2[] = $a;
+     //                    }
+     //                    $value['alarmInfo'] = implode(',', $temp2);
+     //                }else{
+     //                    $value['alarmInfo'] = '否';
+     //                }
+     //            }else{
+     //                $stralarmtype = trim($value['stralarmtype']);
+     //                if (!empty($stralarmtype)) {
+     //                    $alarmArr = explode(',', $stralarmtype);
+     //                    $temp2 = array();
+     //                    foreach ($alarmArr as $a) {
+     //                        if ($a == '电池故障') {
+     //                            $a = '电池电压异常';
+     //                        }
+     //                        if ($value['lampProtocoltype'] == 1) {
+     //                            $temp2[] = modbus_alarm_translate($a);
+     //                        }else{
+     //                            $temp2[] = alarm_translate($a);
+     //                        }
+     //                    }
+     //                    $value['alarmInfo'] = implode(',', $temp2);
+     //                }else{
+     //                    $value['alarmInfo'] = 'Nothing';
+     //                }
+     //            }
+     //        }
+     //        unset($value['failStatus']);
+     //        unset($value['stralarmtype']);
+     //        $data['list'][] = $value;
+    	// }
     	exit(json_result('0000',$this->response['0000'],$data));
     }