|
@@ -123,14 +123,38 @@ class UpdateHkList extends Command
|
|
|
//查询存在index_code列表
|
|
|
$index_code_list = MineList::where('index_code', '!=', null)->get();
|
|
|
|
|
|
- //去掉洗选
|
|
|
+ //不在线矿区
|
|
|
+ $mine_list_ext = DB::table('mine_list_ext')->where('deleted_at',null)->where('ip','!=',null)->get();
|
|
|
+ for($i=0;$i<count($mine_list_ext);$i++){
|
|
|
+ $ip = explode('://',$mine_list_ext[$i]->ip)[1];
|
|
|
+ $port = $mine_list_ext[$i]->port;
|
|
|
+ if($fp = @fsockopen($ip,$port,$errno,$errstr,1)){
|
|
|
+ fclose($fp);
|
|
|
+ }else{
|
|
|
+ $arr[] = $mine_list_ext[$i]->mine_id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //去掉不在线矿区
|
|
|
foreach($index_code_list as $k=>$v){
|
|
|
$degree = explode('|',$v->degree);
|
|
|
- if($degree[0] == 5){
|
|
|
- unset($index_code_list[$k]);
|
|
|
+ if(isset($arr)){
|
|
|
+ for($i=0;$i<count($arr);$i++){
|
|
|
+ if($degree[0] == $arr[$i]){
|
|
|
+ unset($index_code_list[$k]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //去掉洗选
|
|
|
+// foreach($index_code_list as $k=>$v){
|
|
|
+// $degree = explode('|',$v->degree);
|
|
|
+// if($degree[0] == 66){
|
|
|
+// unset($index_code_list[$k]);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
//天地伟业矿区
|
|
|
$mine_ext = DB::table('mine_list_ext')
|
|
|
->select('mine_list_ext.*','mine_list.parent_id')
|
|
@@ -166,8 +190,8 @@ class UpdateHkList extends Command
|
|
|
|
|
|
//宁煤同步摄像头开始时间
|
|
|
$nm_start_time = time();
|
|
|
- $timetotal['mine_id'] = $val->id;
|
|
|
- $timetotal['interface_start_time'] = date('Y-m-d H:i:s');
|
|
|
+// $timetotal['mine_id'] = $val->id;
|
|
|
+// $timetotal['interface_start_time'] = date('Y-m-d H:i:s');
|
|
|
|
|
|
$degree = explode('|', $val->degree);
|
|
|
// $trans_result = CameraServices::getHaiKangTransList($degree[0]);
|
|
@@ -175,8 +199,8 @@ class UpdateHkList extends Command
|
|
|
|
|
|
$info = DB::table('syn')->select('interface','handle')->orderBy('id','desc')->first();
|
|
|
$syn2['interface'] = $info->interface . $val->id . ':' . (time() - $nm_start_time) . ';';
|
|
|
- $timetotal['interface_end_time'] = date('Y-m-d H:i:s');
|
|
|
- $timetotal['handle_start_time'] = date('Y-m-d H:i:s');
|
|
|
+// $timetotal['interface_end_time'] = date('Y-m-d H:i:s');
|
|
|
+// $timetotal['handle_start_time'] = date('Y-m-d H:i:s');
|
|
|
// DB::table('syn')->where('id',$syn_id)->update($syn2);
|
|
|
|
|
|
$handle_start = time();
|
|
@@ -222,9 +246,9 @@ class UpdateHkList extends Command
|
|
|
}
|
|
|
|
|
|
$syn2['handle'] = $info->handle . $val->id . ':' . (time() - $handle_start) . ';';
|
|
|
- $timetotal['handle_end_time'] = date('Y-m-d H:i:s');
|
|
|
+// $timetotal['handle_end_time'] = date('Y-m-d H:i:s');
|
|
|
DB::table('syn')->where('id',$syn_id)->update($syn2);
|
|
|
- DB::table('timetotal')->insert($timetotal);
|
|
|
+// DB::table('timetotal')->insert($timetotal);
|
|
|
|
|
|
if($val->parent_id == 968){
|
|
|
//宁煤同步摄像头时间
|