|
@@ -230,14 +230,22 @@ class IndexController extends MainController
|
|
if(!isset($param['POWERDISCABVOLUME'])||empty($param['POWERDISCABVOLUME'])){$this->api_return_json(array('msg' => '请填写开关柜小室体积'));}
|
|
if(!isset($param['POWERDISCABVOLUME'])||empty($param['POWERDISCABVOLUME'])){$this->api_return_json(array('msg' => '请填写开关柜小室体积'));}
|
|
if(!isset($param['TEMPERPATCHNUM'])||empty($param['TEMPERPATCHNUM'])){$this->api_return_json(array('msg' => '请填写感温贴片数量'));}
|
|
if(!isset($param['TEMPERPATCHNUM'])||empty($param['TEMPERPATCHNUM'])){$this->api_return_json(array('msg' => '请填写感温贴片数量'));}
|
|
//修改
|
|
//修改
|
|
- if ($param['ID']) {
|
|
|
|
|
|
+ $data['DEVICEID']=$param['DEVICEID'];
|
|
|
|
+ $data['DEVICENAME']=$param['DEVICENAME'];
|
|
|
|
+ $data['TEMPERTHRESHOLD']=$param['TEMPERTHRESHOLD'];
|
|
|
|
+ $data['CELLNAME']=$param['CELLNAME'];
|
|
|
|
+ $data['POWERDISCABVOLUME']=$param['POWERDISCABVOLUME'];
|
|
|
|
+ $data['TEMPERPATCHNUM']=$param['TEMPERPATCHNUM'];
|
|
|
|
+ $data['PRIMARYADDR']==$param['PRIMARYADDR'];
|
|
|
|
+
|
|
|
|
+ if (!empty($param['ID'])) {
|
|
$ID=$param['ID'];
|
|
$ID=$param['ID'];
|
|
unset($param['ID']);
|
|
unset($param['ID']);
|
|
$str='添加';
|
|
$str='添加';
|
|
- $res = Db::name('deviceinfo')->where([['ID','=',$ID]])->update($param);
|
|
|
|
|
|
+ $res = Db::name('deviceinfo')->where([['ID','=',$ID]])->update($data);
|
|
} else {
|
|
} else {
|
|
$str='编辑';
|
|
$str='编辑';
|
|
- $res = Db::name('deviceinfo')->insert($param);
|
|
|
|
|
|
+ $res = Db::name('deviceinfo')->insert($data);
|
|
}
|
|
}
|
|
if ($res) {
|
|
if ($res) {
|
|
$this->api_return_json(array('msg' => $str.'成功'), 1);
|
|
$this->api_return_json(array('msg' => $str.'成功'), 1);
|