cameraStatusNm(); } //同步区域列表 public function cameraStatusNm() { // ini_set("memory_limit", "-1"); //宁煤集团 $ningmei = DB::table('mine_list')->where('title',config('mine_hls'))->get(); //所有区域 $mine_all = DB::table('mine_list')->where('deleted_at',null)->get(); $mine_use = [];//宁煤下每个矿所有区域 foreach($mine_all as $key=>$value){ if(count(explode('|',$value->degree)) > 1){ if(explode('|',$value->degree)[0] == $ningmei[0]->id){ $mine_use[] = $value->id; } } } $camera = DB::table('camera_list') ->whereIn('mine_id',$mine_use) ->where('deleted_at',null) ->pluck('index_code','id') ->all(); $query = MineListExt::where('mine_id', $ningmei[0]->id)->first(); Input::replace( [ 'url' => trim($query->ip, '/') . ':' . $query->port, 'key' => $query->key, 'secret' => $query->secret, ] ); $haikang = new HaiKangController(); foreach($camera as $k=>$v){ $res['camera_status'] = $haikang->getCameraStatus($v); DB::table('camera_list')->where('id',$k)->update($res); } } }