gogs 1 year ago
parent
commit
fdc96566f0
1 changed files with 5 additions and 5 deletions
  1. 5 5
      app/Service/ThirdService.php

+ 5 - 5
app/Service/ThirdService.php

@@ -18,7 +18,7 @@ class ThirdService extends Service
         $list = Device::where('del_time',0)->select('*')->get()->toArray();
 
         while (true) {
-            sleep(3);
+            sleep(60);
             $insert = [];
             $jwkey = [];
             foreach ($list as $k=>$v){
@@ -55,12 +55,12 @@ class ThirdService extends Service
 
                 $detail = [
                     'device_name' => $v['title'],
-                    'time' => time(),
+                    'time' => time()*1000,
                     'value' => $value,
                     'device_no' => $v['code'],
                     'data_point_id' => $k,
                     'data_point_name' => $point_name,
-                    'push_time' => time(),
+                    'push_time' => time()*1000,
                     'slave_name' => '',
                 ];
                 $insert[] = $detail;
@@ -79,10 +79,10 @@ class ThirdService extends Service
     }
 
     public function j_rand(){
-        return rand(0,2)+(rand(0,100)/100);
+        return (rand(0,100)/10000);
     }
     public function w_rand(){
-        return rand(0,2)+(rand(0,100)/100);
+        return (rand(0,100)/10000);
     }
     public function cgq_rand(){
         return rand(0,20)+(rand(0,100)/100);