likang 1 jaar geleden
bovenliggende
commit
56dc5df717
2 gewijzigde bestanden met toevoegingen van 40 en 42 verwijderingen
  1. 39 39
      catch/api/controller/Api.php
  2. 1 3
      catch/api/service/dispose.php

+ 39 - 39
catch/api/controller/Api.php

@@ -474,46 +474,46 @@ class Api extends CatchController
 
     //打印日志
     public function temporary_label_log(){
-        $redis=Cache::store('redis')->handler();
-        $key="temporary_label";
-        $list= $redis->HgetAll($key);
-        debug_log($key,json_encode($list));
-        debug_log($key,"所有的标签");
-        foreach($list as $k=>$value){
-            debug_log($key,json_encode([$k=>$value]));
-        }
-        debug_log($key,"所有总数".count($list));
-        debug_log($key,"上报的标签");
-        $i=0;
-        foreach($list as $k=>$value){
-            if($value==2){
-              debug_log($key,json_encode([$k=>$value]));
-              $i++;
-            }
-        }
-        debug_log($key,"正常上报的标签总数".$i);
-        debug_log($key,"补出的标签");
-        $t=0;
-        foreach($list as $k=>$value){
-            if($value==3){
-                $t++;
-              debug_log($key,json_encode([$k=>$value]));
-            }
-        }
-        debug_log($key,"补出的标签总数".$t);
-
-        debug_log($key,"没有上报的的标签");
-        $f=0;
-        foreach($list as $k=>$value){
-            if($value==1){
-                debug_log($key,json_encode([$k=>$value]));
-                $f++;
-            }
+         $redis=Cache::store('redis')->handler();
+        // $key="temporary_label";
+        // $list= $redis->HgetAll($key);
+        // debug_log($key,json_encode($list));
+        // debug_log($key,"所有的标签");
+        // foreach($list as $k=>$value){
+        //     debug_log($key,json_encode([$k=>$value]));
+        // }
+        // debug_log($key,"所有总数".count($list));
+        // debug_log($key,"上报的标签");
+        // $i=0;
+        // foreach($list as $k=>$value){
+        //     if($value==2){
+        //       debug_log($key,json_encode([$k=>$value]));
+        //       $i++;
+        //     }
+        // }
+        // debug_log($key,"正常上报的标签总数".$i);
+        // debug_log($key,"补出的标签");
+        // $t=0;
+        // foreach($list as $k=>$value){
+        //     if($value==3){
+        //         $t++;
+        //       debug_log($key,json_encode([$k=>$value]));
+        //     }
+        // }
+        // debug_log($key,"补出的标签总数".$t);
+
+        // debug_log($key,"没有上报的的标签");
+        // $f=0;
+        // foreach($list as $k=>$value){
+        //     if($value==1){
+        //         debug_log($key,json_encode([$k=>$value]));
+        //         $f++;
+        //     }
             
-        }
-        debug_log($key,"没有上报的的标签总数".$f);
-        // $redis->del($key);
-        $dis= new dispose($redis);
+        // }
+        // debug_log($key,"没有上报的的标签总数".$f);
+        // // $redis->del($key);
+         $dis= new dispose($redis);
        $dis->analysisLog();
         
     }

+ 1 - 3
catch/api/service/dispose.php

@@ -592,7 +592,7 @@ public function get_station_config($mac){
      * 解析日志
      */
     public function analysisLog(){
-        $path=app()->getRootPath()."runtime/log/2023-05-15/label_log.log";
+        $path=app()->getRootPath()."runtime/log/2023-05-28/label_log.log";
         var_dump($path);
         var_dump(is_file($path));
         $file = fopen($path, "rb");
@@ -623,8 +623,6 @@ public function get_station_config($mac){
 
     }
 
-
-
         foreach($array as $item){
             debug_log("in_label",$item);
         }