|
@@ -210,12 +210,31 @@ class IndexController extends MainController
|
|
$arr = array(1 => '80℃', 2 => '2:100℃', 3 => '130℃');
|
|
$arr = array(1 => '80℃', 2 => '2:100℃', 3 => '130℃');
|
|
$sta = array('在线', '报警', '不在线', '未配置');
|
|
$sta = array('在线', '报警', '不在线', '未配置');
|
|
foreach ($deviceinfo as $k => &$v) {
|
|
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']];
|
|
$v['STATUS'] = $sta[is_null($v['STATUS'])? 3:$v['STATUS']];
|
|
}
|
|
}
|
|
|
|
|
|
$this->api_return_json(compact('deviceinfo'), 1);
|
|
$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['POWERDISCABVOLUME']=$param['POWERDISCABVOLUME'];
|
|
$data['TEMPERPATCHNUM']=$param['TEMPERPATCHNUM'];
|
|
$data['TEMPERPATCHNUM']=$param['TEMPERPATCHNUM'];
|
|
$data['PRIMARYADDR']=$param['PRIMARYADDR'];
|
|
$data['PRIMARYADDR']=$param['PRIMARYADDR'];
|
|
|
|
+ $data['POWERDISCABNAME']=$param['POWERDISCABNAME'];
|
|
|
|
|
|
if (!empty($param['ID'])) {
|
|
if (!empty($param['ID'])) {
|
|
$ID=$param['ID'];
|
|
$ID=$param['ID'];
|