Browse Source

摄像头状态历史记录修改

任敬轩 1 year ago
parent
commit
b5bc13af6d
1 changed files with 17 additions and 1 deletions
  1. 17 1
      app/Console/Commands/CameraStatusHistory.php

+ 17 - 1
app/Console/Commands/CameraStatusHistory.php

@@ -51,7 +51,23 @@ class CameraStatusHistory extends Command
         //宁煤集团
         $ningmei = DB::table('mine_list')->where('title',config('mine_hls'))->get();
 
-        $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
+        $ydjk = DB::table('mine_list')->where('title','移动监控')->where('deleted_at',null)->get();
+        $ydjk_list = [];
+        if(count($ydjk) > 0){
+            for($i=0;$i<count($ydjk);$i++){
+                array_push($ydjk_list,$ydjk[$i]->id);
+
+            }
+        }
+        $ydjk_son = DB::table('mine_list')->whereIn('parent_id',$ydjk_list)->where('deleted_at',null)->get();
+        if(count($ydjk_son) > 0){
+            for($i=0;$i<count($ydjk_son);$i++){
+                array_push($ydjk_list,$ydjk_son[$i]->id);
+
+            }
+        }
+
+        $mine_all = DB::table('mine_list')->where('deleted_at',null)->whereNotIn('id',$ydjk_list)->get();//所有区域
         $mine_ningmei = [];//宁煤集团所有区域
         foreach($mine_all as $k=>$v){
             if(explode('|',$v->degree)[0] == $ningmei[0]->id){