Parcourir la source

perf:优化export1

Xu·LinPeng il y a 2 jours
Parent
commit
0a02c90a69
1 fichiers modifiés avec 34 ajouts et 24 suppressions
  1. 34 24
      Modules/Camera/Http/Controllers/Api/CameraApiController.php

+ 34 - 24
Modules/Camera/Http/Controllers/Api/CameraApiController.php

@@ -3058,30 +3058,40 @@ class CameraApiController extends BaseController
             $risk_type_dict[$risk_type_key] = $risk_type_name;
         }
 
-        if(!empty($area_id)){
-            // 风险数据 is_delete = 0 and delete_type = 0 and flow_id is not null
-            $risk_list = DB::connection('mysql_fwe10')
-                ->table('uf_xx_risk_assignment as t')
-                ->select('t.*','t1.shr as coal_shr')
-                ->whereDate('t.create_time', $date)
-                ->where('t.is_delete',0)
-                ->where('t.delete_type',0)
-                ->where('t.wwdw',null)
-                ->where('t.sgdd',null)
-                ->where('t.current_step','结束节点')
-                ->whereNotNull('t.flow_id');
-        }else{
-            // 风险数据 is_delete = 0 and delete_type = 0 and flow_id is not null
-            $risk_list = DB::connection('mysql_fwe10')
-                ->table('uf_xx_risk_assignment as t')
-                ->whereDate('t.create_time', $date)
-                ->where('t.is_delete',0)
-                ->where('t.delete_type',0)
-                ->where('t.wwdw',null)
-                ->where('t.sgdd',null)
-                ->where('t.current_step','结束节点')
-                ->whereNotNull('t.flow_id');
-        }
+//        if(!empty($area_id)){
+//            // 风险数据 is_delete = 0 and delete_type = 0 and flow_id is not null
+//            $risk_list = DB::connection('mysql_fwe10')
+//                ->table('uf_xx_risk_assignment as t')
+//                ->select('t.*','t1.shr as coal_shr')
+//                ->whereDate('t.create_time', $date)
+//                ->where('t.is_delete',0)
+//                ->where('t.delete_type',0)
+//                ->where('t.wwdw',null)
+//                ->where('t.sgdd',null)
+//                ->where('t.current_step','结束节点')
+//                ->whereNotNull('t.flow_id');
+//        }else{
+//            // 风险数据 is_delete = 0 and delete_type = 0 and flow_id is not null
+//            $risk_list = DB::connection('mysql_fwe10')
+//                ->table('uf_xx_risk_assignment as t')
+//                ->whereDate('t.create_time', $date)
+//                ->where('t.is_delete',0)
+//                ->where('t.delete_type',0)
+//                ->where('t.wwdw',null)
+//                ->where('t.sgdd',null)
+//                ->where('t.current_step','结束节点')
+//                ->whereNotNull('t.flow_id');
+//        }
+
+        $risk_list = DB::connection('mysql_fwe10')
+            ->table('uf_xx_risk_assignment as t')
+            ->whereDate('t.create_time', $date)
+            ->where('t.is_delete',0)
+            ->where('t.delete_type',0)
+            ->where('t.wwdw',null)
+            ->where('t.sgdd',null)
+            ->where('t.current_step','结束节点')
+            ->whereNotNull('t.flow_id');
 
         if (!empty($coal_washery_id)) $risk_list->where('t.coal_washery_id', $coal_washery_id); // 筛选洗煤厂
         if (!empty($area_id)) {