Prechádzať zdrojové kódy

天地伟业摄像头同步修改

任敬轩 3 rokov pred
rodič
commit
821fa03a74
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      app/Console/Commands/UpdateHkList.php

+ 5 - 1
app/Console/Commands/UpdateHkList.php

@@ -164,6 +164,7 @@ class UpdateHkList extends Command
                     ->where('degree','like',$mine_list_ext[$i]->mine_id.'|%')
                     ->where('index_code','!=',null)->get();
                 foreach($mine_list as $k=>$v){
+                    $mine_id = $v->id;
                     Input::replace(
                         [
                             'parentOrgIds'   => $v->index_code,
@@ -176,6 +177,7 @@ class UpdateHkList extends Command
                     //获取区域下的子区域
                     $tdwy = new TdwyController();
                     $region = $tdwy->getRegionByOrgId();
+
                     //获取最底层区域摄像头列表
                     if (empty($region['content'])) {
                         Input::replace(
@@ -192,8 +194,9 @@ class UpdateHkList extends Command
                         //获取设备列表
                         $tdwy = new TdwyController();
                         $device_list = $tdwy->queryDeviceList();
+                        $device_index_code = [];
                         //删除区域下所有摄像头
-                        DB::table('camera_list')->where('mine_id',$v->id)->delete();
+//                        DB::table('camera_list')->where('mine_id',$v->id)->delete();
                         if(sizeof($device_list['content'])>0){
                             for($j=0;$j<sizeof($device_list['content']);$j++){//循环添加区域下所有摄像头
                                 if(isset($device_list['content'][$j]['sId'])){//筛选有sId的摄像头
@@ -210,6 +213,7 @@ class UpdateHkList extends Command
                                     ];
                                     CameraList::updateOrCreate(['index_code' => $device_list['content'][$j]['sId']], $params);
                                 }
+                                $device_index_code[$j] = $device_list['content'][$j]['sId'];
                             }
                         }
                     }