Jelajahi Sumber

风险作业接口修改

任敬轩 8 bulan lalu
induk
melakukan
0590150522
1 mengubah file dengan 12 tambahan dan 4 penghapusan
  1. 12 4
      Modules/Camera/Http/Controllers/Api/CameraApiController.php

+ 12 - 4
Modules/Camera/Http/Controllers/Api/CameraApiController.php

@@ -2215,7 +2215,9 @@ class CameraApiController extends BaseController
             '枣泉洗煤厂'=>'zaoquan',
             '大武口洗煤厂'=>'dawukou',
             '金凤洗煤厂'=>'jinfeng',
-            '检修车间'=>'jianxiuchejian',
+            '检修一车间'=>'jianxiuyichejian',
+            '检修二车间'=>'jianxiuerchejian',
+            '检修三车间'=>'jianxiusanchejian',
             '太西洗煤厂'=>'taixi',
             '清水营洗煤厂'=>'qingshuiying',
             '梅花井洗煤厂'=>'meihuajing',
@@ -2229,9 +2231,9 @@ class CameraApiController extends BaseController
             for($i=0;$i<count($coal_washery);$i++){
                 if(array_key_exists($coal_washery[$i]->title, $coal_list)) {
                     $slog = $coal_list[$coal_washery[$i]->title];
-                    $result[$slog]['title'] = $coal_washery[$i]->title;
-                    $result[$slog]['id'] = $coal_washery[$i]->ID;
-                    $result[$slog]['data'] = [
+                    $result['map_data'][$slog]['title'] = $coal_washery[$i]->title;
+                    $result['map_data'][$slog]['id'] = $coal_washery[$i]->ID;
+                    $result['map_data'][$slog]['data'] = [
                         [
                             'name' => '高风险作业',
                             'value'=> 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()
@@ -2245,6 +2247,12 @@ class CameraApiController extends BaseController
                             'value'=> 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()
                         ]
                     ];
+                }else{
+                    $result['other_data']['title'] = $coal_washery[$i]->title;
+                    $result['other_data']['id'] = $coal_washery[$i]->id;
+                    $result['other_data']['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['other_data']['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['other_data']['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();
                 }
             }
         }