瀏覽代碼

摄像头状态同步

任敬轩 2 年之前
父節點
當前提交
9e87f3aa3b
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      app/Console/Commands/NmCameraStatus.php

+ 5 - 3
app/Console/Commands/NmCameraStatus.php

@@ -48,6 +48,7 @@ class NmCameraStatus extends Command
     //同步区域列表
     public function cameraStatusNm()
     {
+//        ini_set("memory_limit", "-1");
         //宁煤集团
         $ningmei = DB::table('mine_list')->where('title',config('mine_hls'))->get();
         //所有区域
@@ -65,7 +66,8 @@ class NmCameraStatus extends Command
         $camera = DB::table('camera_list')
             ->whereIn('mine_id',$mine_use)
             ->where('deleted_at',null)
-            ->get();
+            ->pluck('index_code','id')
+            ->all();
 
         $query = MineListExt::where('mine_id', $ningmei[0]->id)->first();
 
@@ -79,8 +81,8 @@ class NmCameraStatus extends Command
         $haikang   = new HaiKangController();
 
         foreach($camera as $k=>$v){
-            $res['camera_status'] = $haikang->getCameraStatus($v->index_code);
-            DB::table('camera_list')->where('id',$v->id)->update($res);
+            $res['camera_status'] = $haikang->getCameraStatus($v);
+            DB::table('camera_list')->where('id',$k)->update($res);
         }
     }
 }