wang jun 1 year ago
parent
commit
eaaa02e9e7

+ 1 - 1
application/common/model/SettingModel.php

@@ -89,6 +89,6 @@ class SettingModel extends Model
         if (!$info) {
             return false;
         }
-        return $info['value'];
+        return $info['use_value'];
     }
 }

+ 5 - 1
application/common/model/ShinfoModel.php

@@ -140,7 +140,11 @@ class ShinfoModel extends Model
     {
         //判断时长1分钟
         $time = date('Y-m-d H:i:s');
-        $sql = "select * from " . $this->table . " where TIMESTAMPDIFF(MINUTE, updatetime, '" . $time . "')>1 and online_statis=1";
+        $maxtime = 1; //1分钟
+        // $sql = "select * from " . $this->table . " where facility_id in(
+        //     select distinct facility_id from t_shouhuan_receive_redocde
+        //     where TIMESTAMPDIFF(MINUTE, createtime, '" . $time . "')>" . $maxtime . " )  and online_statis=1";
+        $sql = "select * from " . $this->table . " where TIMESTAMPDIFF(MINUTE, receive_time, '" . $time . "')>" . $maxtime . " and online_statis=1";
         $list = $this->query($sql);
         return $list;
     }

+ 2 - 5
application/common/server/ShouhuanCommand.php

@@ -80,7 +80,7 @@ class ShouhuanCommand
         if ('send' == $config['kind']) {
             $content = $config['content'];
             $useconmmand = $content['command'];
-            $content_custom = isset($content['content_custom']) ? $content['content_custom'] : false;
+            $content_custom = isset($config['content_custom']) ? $config['content_custom'] : false;
             $need_back = $config['need_back'];
             if ($content_custom) {
                 $functionname = 'get' . $command . "Commandinfo";
@@ -348,7 +348,7 @@ class ShouhuanCommand
             ],
             'PHL' => [
                 'content' => [
-                    'command' => 'PEDO',
+                    'command' => 'PHL',
                 ],
                 'kind' => 'send',
                 'content_custom' => true,
@@ -510,9 +510,6 @@ class ShouhuanCommand
         if (50 < count($param)) {
             throw new \Exception("PHL参数错误");
         }
-        if (0 != count($param) % 2) {
-            throw new \Exception("PHL参数长度错误");
-        }
         $usedata = [];
         foreach ($param as $key => $value) {
             $telno = $value['telno'];

+ 12 - 0
application/common/server/SouhuanAnalysis.php

@@ -68,6 +68,18 @@ class SouhuanAnalysis
         }
         //验证设备状态
         $fid = $this->getfacilityid($device_id_code);
+        if ($fid) {
+            //改设备接收信息时间
+            $time = date('Y-m-d H:i:s');
+            $shupdateData = ['receive_time' => $time];
+            $shupdateWhere = ['facility_id' => $fid];
+            $m_f = new FacilityModel();
+            $row = $m_f->updateinfo($shupdateWhere, $shupdateData);
+            if (empty($row)) {
+                $errmsg = '设备:' . $device_id_code . " receive_time 修改失败";
+                Log::write($errmsg, 'shouhuan');
+            }
+        }
         $data = [
             'device_id_code' => $device_id_code,
             'content_len' => $content_len,