fcy пре 4 година
родитељ
комит
2b29bdebc4
1 измењених фајлова са 11 додато и 3 уклоњено
  1. 11 3
      application/web/controller/IndexController.php

+ 11 - 3
application/web/controller/IndexController.php

@@ -230,14 +230,22 @@ class IndexController extends MainController
         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 ($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'];
             unset($param['ID']);
             $str='添加';
-            $res = Db::name('deviceinfo')->where([['ID','=',$ID]])->update($param);
+            $res = Db::name('deviceinfo')->where([['ID','=',$ID]])->update($data);
         } else {
             $str='编辑';
-            $res = Db::name('deviceinfo')->insert($param);
+            $res = Db::name('deviceinfo')->insert($data);
         }
         if ($res) {
             $this->api_return_json(array('msg' => $str.'成功'), 1);