fcy 4 lat temu
rodzic
commit
b23e5f11d6
1 zmienionych plików z 21 dodań i 1 usunięć
  1. 21 1
      application/web/controller/IndexController.php

+ 21 - 1
application/web/controller/IndexController.php

@@ -210,12 +210,31 @@ class IndexController extends MainController
         $arr = array(1 => '80℃', 2 => '2:100℃', 3 => '130℃');
         $sta = array('在线', '报警', '不在线', '未配置');
         foreach ($deviceinfo as $k => &$v) {
-            $v['TEMPERTHRESHOLD'] = array_key_exists((int)$v['TEMPERTHRESHOLD'],$arr)?$arr[(int)$v['TEMPERTHRESHOLD']]:1;
+            $v['TEMPERTHRESHOLD'] = array_key_exists((int)$v['TEMPERTHRESHOLD'],$arr)?$arr[(int)$v['TEMPERTHRESHOLD']]:'80℃';
             $v['STATUS'] = $sta[is_null($v['STATUS'])? 3:$v['STATUS']];
         }
 
         $this->api_return_json(compact('deviceinfo'), 1);
 
+    }
+
+	/*
+     * @name 编辑页面数据接口
+     * */
+    public function deviceedit(){
+        $ID = $this->request->param('ID');
+        $data['DEVICEID']='';
+		$data['DEVICENAME']='';
+		$data['TEMPERTHRESHOLD']='';
+		$data['CELLNAME']='';
+		$data['POWERDISCABVOLUME']='';
+		$data['TEMPERPATCHNUM']='';
+		$data['POWERDISCABNAME']='';
+
+        if ($ID) {
+            $edit = Db::name('deviceinfo')->where([['ID','=',$ID]])->find();
+        }
+        $this->api_return_json(compact('deviceedit'), 1);
     }
     /*
      *
@@ -237,6 +256,7 @@ class IndexController extends MainController
 		$data['POWERDISCABVOLUME']=$param['POWERDISCABVOLUME'];
 		$data['TEMPERPATCHNUM']=$param['TEMPERPATCHNUM'];
 		$data['PRIMARYADDR']=$param['PRIMARYADDR'];
+		$data['POWERDISCABNAME']=$param['POWERDISCABNAME'];
 
         if (!empty($param['ID'])) {
             $ID=$param['ID'];