浏览代码

no message

wzh 5 年之前
父节点
当前提交
0d19b5386d
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      api/application/controllers/Lampcontrol.php

+ 3 - 3
api/application/controllers/Lampcontrol.php

@@ -1428,12 +1428,12 @@ class Lampcontrol extends Base_Controller {
             $update['updatetime']       = date("Y-m-d H:i:s");
             $update['nextquerytime']    = date("Y-m-d H:i:s");
 
-            $ret = $this->Patrol_model->getOne($where['id']);
+            $ret = $this->Patrol_model->get_one($where);
             if(empty($ret)){
                 $update['id'] = $where['id'];
-                $this->Patrol_model->insert($update);
+                $this->Patrol_model->add($update);
             } else {
-                $this->Patrol_model->update($where,$update);
+                $this->Patrol_model->update($update,$where);
             }
             $res = $this->Lamp_model->getOne($lampid,'N.protocoltype,L.address,L.protocoltype AS lampprotocoltype');
             if ($res['protocoltype'] == 4) {