|
@@ -2516,63 +2516,53 @@ class CameraApiController extends BaseController
|
|
return self::errorResponse(ApiEnum::STATUS_CODE_EMPTY);
|
|
return self::errorResponse(ApiEnum::STATUS_CODE_EMPTY);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $result['camera'] = [];
|
|
|
|
+ $result['move_camera'] = [];
|
|
|
|
+ $result['zhifa_camera'] = [];
|
|
|
|
+
|
|
$risk_type = ['高空坠落','起重伤害','触电','火灾','机械伤害','中毒和窒息'];
|
|
$risk_type = ['高空坠落','起重伤害','触电','火灾','机械伤害','中毒和窒息'];
|
|
$risk_level = ['高风险','中风险','低风险'];
|
|
$risk_level = ['高风险','中风险','低风险'];
|
|
|
|
|
|
- $type = '';
|
|
|
|
- $camera_name = '无';
|
|
|
|
- $result['camera']['camera_id'] = '';
|
|
|
|
- $result['camera']['parent_id'] = '';
|
|
|
|
-
|
|
|
|
- $move_type = '';
|
|
|
|
- $move_camera_name = '无';
|
|
|
|
- $result['move_camera']['camera_id'] = '';
|
|
|
|
- $result['move_camera']['parent_id'] = '';
|
|
|
|
-
|
|
|
|
- $zhifa_type = '';
|
|
|
|
- $zhifa_camera_name = '无';
|
|
|
|
- $result['zhifa_camera']['camera_id'] = '';
|
|
|
|
- $result['zhifa_camera']['parent_id'] = '';
|
|
|
|
-
|
|
|
|
- $risk = DB::connection('task_xixuan')->table('xx_risk_assignment')
|
|
|
|
- ->select('xx_risk_assignment.*','xx_coal_washery.name as coal_washery')
|
|
|
|
- ->leftJoin('xx_coal_washery','xx_coal_washery.id','=','xx_risk_assignment.coal_washery_id')
|
|
|
|
- ->where('xx_risk_assignment.id',$params['id'])->get();
|
|
|
|
|
|
+ $risk = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')
|
|
|
|
+ ->select('uf_xx_risk_assignment.*','uf_xx_coal_washery.name as coal_washery')
|
|
|
|
+ ->leftJoin('uf_xx_coal_washery','uf_xx_coal_washery.id','=','uf_xx_risk_assignment.coal_washery_id')
|
|
|
|
+ ->where('uf_xx_risk_assignment.id',$params['id'])->get();
|
|
|
|
|
|
if(count($risk) > 0){
|
|
if(count($risk) > 0){
|
|
- $camera_info = explode('|',$risk[0]->camera_id);
|
|
|
|
-
|
|
|
|
- if(count($camera_info) > 1){
|
|
|
|
- $camera_name = $camera_info[2];
|
|
|
|
- $is_hak = MineListExt::where('mine_id', $camera_info[1])->value('is_hak');
|
|
|
|
- if($is_hak == 2){
|
|
|
|
- $type = 'rtsp';
|
|
|
|
- }else{
|
|
|
|
- $type = 'm3u8';
|
|
|
|
|
|
+ $camera_info = explode(',',$risk[0]->camera);
|
|
|
|
+ if($camera_info[0] != ''){
|
|
|
|
+ for($i=0;$i<count($camera_info);$i++){
|
|
|
|
+ preg_match('/^(.*)\((\d+)\)$/', $camera_info[$i], $matches);
|
|
|
|
+ if (isset($matches[1]) && isset($matches[2])) {
|
|
|
|
+ $result['camera'][$i]['camera_name'] = $matches[1];
|
|
|
|
+ $result['camera'][$i]['camera_id'] = $matches[2];
|
|
|
|
+ $result['camera'][$i]['parent_id'] = DB::table('camera_list')->where('id',$matches[2])->pluck('mine_id')[0];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- $move_camera_info = explode('|',$risk[0]->move_camera_id);
|
|
|
|
|
|
+ $move_camera_info = explode(',',$risk[0]->move_camera);
|
|
|
|
|
|
- if(count($move_camera_info) > 1){
|
|
|
|
- $move_camera_name = $move_camera_info[2];
|
|
|
|
- $is_hak = MineListExt::where('mine_id', $move_camera_info[1])->value('is_hak');
|
|
|
|
- if($is_hak == 2){
|
|
|
|
- $move_type = 'rtsp';
|
|
|
|
- }else{
|
|
|
|
- $move_type = 'm3u8';
|
|
|
|
|
|
+ if($move_camera_info[0] != ''){
|
|
|
|
+ for($i=0;$i<count($move_camera_info);$i++){
|
|
|
|
+ preg_match('/^(.*)\((\d+)\)$/', $move_camera_info[$i], $matches2);
|
|
|
|
+ if (isset($matches2[1]) && isset($matches2[2])) {
|
|
|
|
+ $result['move_camera'][$i]['camera_name'] = $matches2[1];
|
|
|
|
+ $result['move_camera'][$i]['camera_id'] = $matches2[2];
|
|
|
|
+ $result['move_camera'][$i]['parent_id'] = DB::table('camera_list')->where('id',$matches2[2])->pluck('mine_id')[0];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- $zhifa_camera_info = explode('|',$risk[0]->zhifa_camera_id);
|
|
|
|
-
|
|
|
|
- if(count($zhifa_camera_info) > 1){
|
|
|
|
- $zhifa_camera_name = $zhifa_camera_info[2];
|
|
|
|
- $is_hak = MineListExt::where('mine_id', $zhifa_camera_info[1])->value('is_hak');
|
|
|
|
- if($is_hak == 2){
|
|
|
|
- $zhifa_type = 'rtsp';
|
|
|
|
- }else{
|
|
|
|
- $zhifa_type = 'm3u8';
|
|
|
|
|
|
+ $zhifa_camera_info = explode(',',$risk[0]->zhifa_camera);
|
|
|
|
+ if($zhifa_camera_info[0] != ''){
|
|
|
|
+ for($i=0;$i<count($zhifa_camera_info);$i++){
|
|
|
|
+ preg_match('/^(.*)\((\d+)\)$/', $zhifa_camera_info[$i], $matches3);
|
|
|
|
+ if (isset($matches3[1]) && isset($matches3[2])) {
|
|
|
|
+ $result['zhifa_camera'][$i]['camera_name'] = $matches3[1];
|
|
|
|
+ $result['zhifa_camera'][$i]['camera_id'] = $matches3[2];
|
|
|
|
+ $result['zhifa_camera'][$i]['parent_id'] = DB::table('camera_list')->where('id',$matches3[2])->pluck('mine_id')[0];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2613,7 +2603,7 @@ class CameraApiController extends BaseController
|
|
],
|
|
],
|
|
[
|
|
[
|
|
'label' => '作业地点:',
|
|
'label' => '作业地点:',
|
|
- 'value' => $risk[0]->work_location
|
|
|
|
|
|
+ 'value' => $risk[0]->risk_location
|
|
],
|
|
],
|
|
[
|
|
[
|
|
'label' => '现场负责人:',
|
|
'label' => '现场负责人:',
|
|
@@ -2621,48 +2611,9 @@ class CameraApiController extends BaseController
|
|
],
|
|
],
|
|
[
|
|
[
|
|
'label' => '进展情况:',
|
|
'label' => '进展情况:',
|
|
- 'value' => $risk[0]->describe
|
|
|
|
- ],
|
|
|
|
- [
|
|
|
|
- 'label' => '固定摄像头:',
|
|
|
|
- 'value' => $camera_name
|
|
|
|
- ],
|
|
|
|
- [
|
|
|
|
- 'label' => '移动摄像头:',
|
|
|
|
- 'value' => $move_camera_name
|
|
|
|
- ],
|
|
|
|
- [
|
|
|
|
- 'label' => '执法记录仪:',
|
|
|
|
- 'value' => $zhifa_camera_name
|
|
|
|
- ],
|
|
|
|
|
|
+ 'value' => $risk[0]->risk_describe
|
|
|
|
+ ]
|
|
];
|
|
];
|
|
-
|
|
|
|
- $camera_id = explode('|',$risk[0]->camera_id);
|
|
|
|
-
|
|
|
|
- if(count($camera_id) > 1){
|
|
|
|
- $result['camera']['camera_id'] = $camera_id[0];
|
|
|
|
- $result['camera']['parent_id'] = $camera_id[1];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $result['camera']['camera_type'] = $type;
|
|
|
|
-
|
|
|
|
- $move_camera_id = explode('|',$risk[0]->move_camera_id);
|
|
|
|
-
|
|
|
|
- if(count($move_camera_id) > 1){
|
|
|
|
- $result['move_camera']['camera_id'] = $move_camera_id[0];
|
|
|
|
- $result['move_camera']['parent_id'] = $move_camera_id[1];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $result['move_camera']['camera_type'] = $move_type;
|
|
|
|
-
|
|
|
|
- $zhifa_camera_id = explode('|',$risk[0]->zhifa_camera_id);
|
|
|
|
-
|
|
|
|
- if(count($zhifa_camera_id) > 1){
|
|
|
|
- $result['zhifa_camera']['camera_id'] = $zhifa_camera_id[0];
|
|
|
|
- $result['zhifa_camera']['parent_id'] = $zhifa_camera_id[1];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $result['zhifa_camera']['camera_type'] = $zhifa_type;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return self::successResponse($result);
|
|
return self::successResponse($result);
|
|
@@ -2674,10 +2625,10 @@ class CameraApiController extends BaseController
|
|
$risk_level = ['高风险','中风险','低风险'];
|
|
$risk_level = ['高风险','中风险','低风险'];
|
|
|
|
|
|
//高风险作业
|
|
//高风险作业
|
|
- $gaofengxian = DB::connection('task_xixuan')->table('xx_risk_assignment')
|
|
|
|
- ->select('xx_risk_assignment.*','xx_coal_washery.name as coal_washery')
|
|
|
|
- ->leftJoin('xx_coal_washery','xx_coal_washery.id','=','xx_risk_assignment.coal_washery_id')
|
|
|
|
- ->whereDate('xx_risk_assignment.optdt', today())
|
|
|
|
|
|
+ $gaofengxian = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')
|
|
|
|
+ ->select('uf_xx_risk_assignment.*','uf_xx_coal_washery.name as coal_washery')
|
|
|
|
+ ->leftJoin('uf_xx_coal_washery','uf_xx_coal_washery.id','=','uf_xx_risk_assignment.coal_washery_id')
|
|
|
|
+ ->whereDate('uf_xx_risk_assignment.create_time', today())
|
|
->where('risk_level',0)->get();
|
|
->where('risk_level',0)->get();
|
|
if(count($gaofengxian) > 0){
|
|
if(count($gaofengxian) > 0){
|
|
for($i=0;$i<count($gaofengxian);$i++){
|
|
for($i=0;$i<count($gaofengxian);$i++){
|
|
@@ -2686,19 +2637,20 @@ class CameraApiController extends BaseController
|
|
}else{
|
|
}else{
|
|
$gaofengxian[$i]->risk_type_name = $risk_type[$gaofengxian[$i]->risk_type];
|
|
$gaofengxian[$i]->risk_type_name = $risk_type[$gaofengxian[$i]->risk_type];
|
|
}
|
|
}
|
|
- $camera_info = explode('|',$gaofengxian[$i]->camera_id);
|
|
|
|
- $gaofengxian[$i]->camera_type = CameraEnum::CAMERA_TYPE_EXCHANGE[$camera_info[3]];
|
|
|
|
|
|
+ $camera_info = explode(',',$gaofengxian[$i]->camera);
|
|
|
|
+ $gaofengxian[$i]->camera_type = '普通摄像头';
|
|
$gaofengxian[$i]->risk_level_name = $risk_level[$gaofengxian[$i]->risk_level];
|
|
$gaofengxian[$i]->risk_level_name = $risk_level[$gaofengxian[$i]->risk_level];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
$result['gao_count'] = count($gaofengxian);
|
|
$result['gao_count'] = count($gaofengxian);
|
|
$result['gao'] = $gaofengxian;
|
|
$result['gao'] = $gaofengxian;
|
|
|
|
|
|
//中风险作业
|
|
//中风险作业
|
|
- $zhongfengxian = DB::connection('task_xixuan')->table('xx_risk_assignment')
|
|
|
|
- ->select('xx_risk_assignment.*','xx_coal_washery.name as coal_washery')
|
|
|
|
- ->leftJoin('xx_coal_washery','xx_coal_washery.id','=','xx_risk_assignment.coal_washery_id')
|
|
|
|
- ->whereDate('xx_risk_assignment.optdt', today())
|
|
|
|
|
|
+ $zhongfengxian = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')
|
|
|
|
+ ->select('uf_xx_risk_assignment.*','uf_xx_coal_washery.name as coal_washery')
|
|
|
|
+ ->leftJoin('uf_xx_coal_washery','uf_xx_coal_washery.id','=','uf_xx_risk_assignment.coal_washery_id')
|
|
|
|
+ ->whereDate('uf_xx_risk_assignment.create_time', today())
|
|
->where('risk_level',1)->get();
|
|
->where('risk_level',1)->get();
|
|
if(count($zhongfengxian) > 0){
|
|
if(count($zhongfengxian) > 0){
|
|
for($i=0;$i<count($zhongfengxian);$i++){
|
|
for($i=0;$i<count($zhongfengxian);$i++){
|
|
@@ -2707,8 +2659,8 @@ class CameraApiController extends BaseController
|
|
}else{
|
|
}else{
|
|
$zhongfengxian[$i]->risk_type_name = $risk_type[$zhongfengxian[$i]->risk_type];
|
|
$zhongfengxian[$i]->risk_type_name = $risk_type[$zhongfengxian[$i]->risk_type];
|
|
}
|
|
}
|
|
- $camera_info = explode('|',$zhongfengxian[$i]->camera_id);
|
|
|
|
- $zhongfengxian[$i]->camera_type = CameraEnum::CAMERA_TYPE_EXCHANGE[$camera_info[3]];
|
|
|
|
|
|
+ $camera_info = explode(',',$zhongfengxian[$i]->camera);
|
|
|
|
+ $zhongfengxian[$i]->camera_type = '普通摄像头';
|
|
$zhongfengxian[$i]->risk_level_name = $risk_level[$zhongfengxian[$i]->risk_level];
|
|
$zhongfengxian[$i]->risk_level_name = $risk_level[$zhongfengxian[$i]->risk_level];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2716,10 +2668,10 @@ class CameraApiController extends BaseController
|
|
$result['zhong'] = $zhongfengxian;
|
|
$result['zhong'] = $zhongfengxian;
|
|
|
|
|
|
//低风险作业
|
|
//低风险作业
|
|
- $difengxian = DB::connection('task_xixuan')->table('xx_risk_assignment')
|
|
|
|
- ->select('xx_risk_assignment.*','xx_coal_washery.name as coal_washery')
|
|
|
|
- ->leftJoin('xx_coal_washery','xx_coal_washery.id','=','xx_risk_assignment.coal_washery_id')
|
|
|
|
- ->whereDate('xx_risk_assignment.optdt', today())
|
|
|
|
|
|
+ $difengxian = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')
|
|
|
|
+ ->select('uf_xx_risk_assignment.*','uf_xx_coal_washery.name as coal_washery')
|
|
|
|
+ ->leftJoin('uf_xx_coal_washery','uf_xx_coal_washery.id','=','uf_xx_risk_assignment.coal_washery_id')
|
|
|
|
+ ->whereDate('uf_xx_risk_assignment.create_time', today())
|
|
->where('risk_level',2)->get();
|
|
->where('risk_level',2)->get();
|
|
if(count($difengxian) > 0){
|
|
if(count($difengxian) > 0){
|
|
for($i=0;$i<count($difengxian);$i++){
|
|
for($i=0;$i<count($difengxian);$i++){
|
|
@@ -2728,8 +2680,8 @@ class CameraApiController extends BaseController
|
|
}else{
|
|
}else{
|
|
$difengxian[$i]->risk_type_name = $risk_type[$difengxian[$i]->risk_type];
|
|
$difengxian[$i]->risk_type_name = $risk_type[$difengxian[$i]->risk_type];
|
|
}
|
|
}
|
|
- $camera_info = explode('|',$difengxian[$i]->camera_id);
|
|
|
|
- $difengxian[$i]->camera_type = CameraEnum::CAMERA_TYPE_EXCHANGE[$camera_info[3]];
|
|
|
|
|
|
+ $camera_info = explode(',',$difengxian[$i]->camera);
|
|
|
|
+ $difengxian[$i]->camera_type = '普通摄像头';
|
|
$difengxian[$i]->risk_level_name = $risk_level[$difengxian[$i]->risk_level];
|
|
$difengxian[$i]->risk_level_name = $risk_level[$difengxian[$i]->risk_level];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2737,25 +2689,25 @@ class CameraApiController extends BaseController
|
|
$result['di'] = $difengxian;
|
|
$result['di'] = $difengxian;
|
|
|
|
|
|
//片区作业数
|
|
//片区作业数
|
|
- $area = DB::connection('task_xixuan')->table('xx_area')->get();
|
|
|
|
|
|
+ $area = DB::connection('mysql_fwe10')->table('uf_xx_area')->get();
|
|
$result['area_count'] = [];
|
|
$result['area_count'] = [];
|
|
if(count($area) > 0){
|
|
if(count($area) > 0){
|
|
for($i=0;$i<count($area);$i++){
|
|
for($i=0;$i<count($area);$i++){
|
|
- $result['area_count'][$i]['name'] = $area[$i]->name;
|
|
|
|
- $coal_washery_id_list = DB::connection('task_xixuan')->table('xx_coal_washery')->where('area_id',$area[$i]->id)->pluck('id');
|
|
|
|
- $result['area_count'][$i]['count'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', today())->count();
|
|
|
|
|
|
+ $result['area_count'][$i]['name'] = $area[$i]->title;
|
|
|
|
+ $coal_washery_id_list = DB::connection('mysql_fwe10')->table('uf_xx_coal_washery')->where('area_id',$area[$i]->ID)->pluck('id');
|
|
|
|
+ $result['area_count'][$i]['count'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', today())->count();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//洗煤厂作业
|
|
//洗煤厂作业
|
|
- $coal_washery = DB::connection('task_xixuan')->table('xx_coal_washery')->get();
|
|
|
|
|
|
+ $coal_washery = DB::connection('mysql_fwe10')->table('uf_xx_coal_washery')->get();
|
|
$result['coal_washery_work_count'] = [];
|
|
$result['coal_washery_work_count'] = [];
|
|
if(count($coal_washery) > 0){
|
|
if(count($coal_washery) > 0){
|
|
for($i=0;$i<count($coal_washery);$i++){
|
|
for($i=0;$i<count($coal_washery);$i++){
|
|
- $result['coal_washery_work_count'][$i]['name'] = $coal_washery[$i]->name;
|
|
|
|
- $result['coal_washery_work_count'][$i]['gao'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->where('coal_washery_id',$coal_washery[$i]->id)->where('risk_level',0)->whereDate('optdt', today())->count();
|
|
|
|
- $result['coal_washery_work_count'][$i]['zhong'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->where('coal_washery_id',$coal_washery[$i]->id)->where('risk_level',1)->whereDate('optdt', today())->count();
|
|
|
|
- $result['coal_washery_work_count'][$i]['di'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->where('coal_washery_id',$coal_washery[$i]->id)->where('risk_level',2)->whereDate('optdt', today())->count();
|
|
|
|
|
|
+ $result['coal_washery_work_count'][$i]['name'] = $coal_washery[$i]->title;
|
|
|
|
+ $result['coal_washery_work_count'][$i]['gao'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->where('coal_washery_id',$coal_washery[$i]->ID)->where('risk_level',0)->whereDate('create_time', today())->count();
|
|
|
|
+ $result['coal_washery_work_count'][$i]['zhong'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->where('coal_washery_id',$coal_washery[$i]->ID)->where('risk_level',1)->whereDate('create_time', today())->count();
|
|
|
|
+ $result['coal_washery_work_count'][$i]['di'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->where('coal_washery_id',$coal_washery[$i]->ID)->where('risk_level',2)->whereDate('create_time', today())->count();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2764,24 +2716,24 @@ class CameraApiController extends BaseController
|
|
for($i=0;$i<7;$i++){
|
|
for($i=0;$i<7;$i++){
|
|
$day = date('Y-m-d', strtotime('-'.$i.' day'));
|
|
$day = date('Y-m-d', strtotime('-'.$i.' day'));
|
|
$result['seven_work_count'][$i]['date'] = $day;
|
|
$result['seven_work_count'][$i]['date'] = $day;
|
|
- $result['seven_work_count'][$i]['gao'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereDate('optdt', $day)->where('risk_level',0)->count();
|
|
|
|
- $result['seven_work_count'][$i]['zhong'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereDate('optdt', $day)->where('risk_level',1)->count();
|
|
|
|
- $result['seven_work_count'][$i]['di'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereDate('optdt', $day)->where('risk_level',2)->count();
|
|
|
|
|
|
+ $result['seven_work_count'][$i]['gao'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereDate('create_time', $day)->where('risk_level',0)->count();
|
|
|
|
+ $result['seven_work_count'][$i]['zhong'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereDate('create_time', $day)->where('risk_level',1)->count();
|
|
|
|
+ $result['seven_work_count'][$i]['di'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereDate('create_time', $day)->where('risk_level',2)->count();
|
|
}
|
|
}
|
|
|
|
|
|
//7天片区作业数
|
|
//7天片区作业数
|
|
$result['seven_area_work_count'] = [];
|
|
$result['seven_area_work_count'] = [];
|
|
if(count($area) > 0){
|
|
if(count($area) > 0){
|
|
for($i=0;$i<count($area);$i++){
|
|
for($i=0;$i<count($area);$i++){
|
|
- $result['seven_area_work_count'][$i]['name'] = $area[$i]->name;
|
|
|
|
- $result['seven_area_work_count'][$i]['area_id'] = $area[$i]->id;
|
|
|
|
|
|
+ $result['seven_area_work_count'][$i]['name'] = $area[$i]->title;
|
|
|
|
+ $result['seven_area_work_count'][$i]['area_id'] = $area[$i]->ID;
|
|
for($j=0;$j<7;$j++){
|
|
for($j=0;$j<7;$j++){
|
|
$day = date('Y-m-d', strtotime('-'.$j.' day'));
|
|
$day = date('Y-m-d', strtotime('-'.$j.' day'));
|
|
$result['seven_area_work_count'][$i]['work'][$j]['date'] = $day;
|
|
$result['seven_area_work_count'][$i]['work'][$j]['date'] = $day;
|
|
- $coal_washery_id_list = DB::connection('task_xixuan')->table('xx_coal_washery')->where('area_id',$area[$i]->id)->pluck('id');
|
|
|
|
- $result['seven_area_work_count'][$i]['work'][$j]['gao'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', $day)->where('risk_level',0)->count();
|
|
|
|
- $result['seven_area_work_count'][$i]['work'][$j]['zhong'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', $day)->where('risk_level',1)->count();
|
|
|
|
- $result['seven_area_work_count'][$i]['work'][$j]['di'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', $day)->where('risk_level',2)->count();
|
|
|
|
|
|
+ $coal_washery_id_list = DB::connection('mysql_fwe10')->table('uf_xx_coal_washery')->where('area_id',$area[$i]->ID)->pluck('id');
|
|
|
|
+ $result['seven_area_work_count'][$i]['work'][$j]['gao'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', $day)->where('risk_level',0)->count();
|
|
|
|
+ $result['seven_area_work_count'][$i]['work'][$j]['zhong'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', $day)->where('risk_level',1)->count();
|
|
|
|
+ $result['seven_area_work_count'][$i]['work'][$j]['di'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', $day)->where('risk_level',2)->count();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2808,9 +2760,9 @@ class CameraApiController extends BaseController
|
|
$i = 0;
|
|
$i = 0;
|
|
while ($current_date <= $end_date) {
|
|
while ($current_date <= $end_date) {
|
|
$result[$i]['date'] = $current_date;
|
|
$result[$i]['date'] = $current_date;
|
|
- $result[$i]['gao'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereDate('optdt', $current_date)->where('risk_level',0)->count();
|
|
|
|
- $result[$i]['zhong'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereDate('optdt', $current_date)->where('risk_level',1)->count();
|
|
|
|
- $result[$i]['di'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereDate('optdt', $current_date)->where('risk_level',2)->count();
|
|
|
|
|
|
+ $result[$i]['gao'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereDate('create_time', $current_date)->where('risk_level',0)->count();
|
|
|
|
+ $result[$i]['zhong'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereDate('create_time', $current_date)->where('risk_level',1)->count();
|
|
|
|
+ $result[$i]['di'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereDate('create_time', $current_date)->where('risk_level',2)->count();
|
|
$current_date = date('Y-m-d', strtotime($current_date . ' +1 day'));
|
|
$current_date = date('Y-m-d', strtotime($current_date . ' +1 day'));
|
|
$i++;
|
|
$i++;
|
|
}
|
|
}
|
|
@@ -2834,7 +2786,7 @@ class CameraApiController extends BaseController
|
|
return self::errorResponse(ApiEnum::STATUS_CODE_EMPTY);
|
|
return self::errorResponse(ApiEnum::STATUS_CODE_EMPTY);
|
|
}
|
|
}
|
|
|
|
|
|
- $coal_washery_id_list = DB::connection('task_xixuan')->table('xx_coal_washery')->where('area_id',$params['area_id'])->pluck('id');
|
|
|
|
|
|
+ $coal_washery_id_list = DB::connection('mysql_fwe10')->table('uf_xx_coal_washery')->where('area_id',$params['area_id'])->pluck('id');
|
|
$result = [];
|
|
$result = [];
|
|
$start_date = $params['start_date'];
|
|
$start_date = $params['start_date'];
|
|
$end_date = $params['end_date'];
|
|
$end_date = $params['end_date'];
|
|
@@ -2843,9 +2795,9 @@ class CameraApiController extends BaseController
|
|
|
|
|
|
while ($current_date <= $end_date) {
|
|
while ($current_date <= $end_date) {
|
|
$result[$i]['date'] = $current_date;
|
|
$result[$i]['date'] = $current_date;
|
|
- $result[$i]['gao'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', $current_date)->where('risk_level',0)->count();
|
|
|
|
- $result[$i]['zhong'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', $current_date)->where('risk_level',1)->count();
|
|
|
|
- $result[$i]['di'] = DB::connection('task_xixuan')->table('xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('optdt', $current_date)->where('risk_level',2)->count();
|
|
|
|
|
|
+ $result[$i]['gao'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', $current_date)->where('risk_level',0)->count();
|
|
|
|
+ $result[$i]['zhong'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', $current_date)->where('risk_level',1)->count();
|
|
|
|
+ $result[$i]['di'] = DB::connection('mysql_fwe10')->table('uf_xx_risk_assignment')->whereIn('coal_washery_id',$coal_washery_id_list)->whereDate('create_time', $current_date)->where('risk_level',2)->count();
|
|
$current_date = date('Y-m-d', strtotime($current_date . ' +1 day'));
|
|
$current_date = date('Y-m-d', strtotime($current_date . ' +1 day'));
|
|
$i++;
|
|
$i++;
|
|
}
|
|
}
|