|
@@ -3577,26 +3577,41 @@ class CameraApiController extends BaseController
|
|
|
->orderBy('sort')->get();
|
|
|
|
|
|
|
|
|
- $risk_list_data = DB::connection('mysql_fwe10')
|
|
|
- ->table('uf_xx_risk_assignment as t')
|
|
|
- ->whereDate('create_time', $date)
|
|
|
-// ->where('coal_washery_id',$coal_list[$i]->ID)
|
|
|
- ->where('wcqk',0)
|
|
|
- ->where('t.is_delete',0)
|
|
|
- ->where('t.delete_type',0)
|
|
|
- ->where('t.current_step','结束节点')
|
|
|
- ->whereNotNull('t.flow_id')
|
|
|
- ->orderBy('create_time')->get();
|
|
|
-
|
|
|
- $risk_list_list = [];
|
|
|
- foreach ($risk_list_data as $key => $value) {
|
|
|
- $risk_list_list[$value['coal_washery_id']] = $value;
|
|
|
- }
|
|
|
+ // 以下的优化方式有问题,接口报错
|
|
|
+ // 1. foreach 循环后的 $risk_list_list 与 $risk_list_data 数据量不同
|
|
|
+ // 2. $risk_list 不能使用 count()函数统计个数
|
|
|
+
|
|
|
+// $risk_list_data = DB::connection('mysql_fwe10')
|
|
|
+// ->table('uf_xx_risk_assignment as t')
|
|
|
+// ->whereDate('create_time', $date)
|
|
|
+//// ->where('coal_washery_id',$coal_list[$i]->ID)
|
|
|
+// ->where('wcqk',0)
|
|
|
+// ->where('t.is_delete',0)
|
|
|
+// ->where('t.delete_type',0)
|
|
|
+// ->where('t.current_step','结束节点')
|
|
|
+// ->whereNotNull('t.flow_id')
|
|
|
+// ->orderBy('create_time')->get();
|
|
|
+
|
|
|
+// $risk_list_list = [];
|
|
|
+// foreach ($risk_list_data as $key => $value) {
|
|
|
+// $risk_list_list[$value['coal_washery_id']] = $value;
|
|
|
+// }
|
|
|
|
|
|
if(count($coal_list) > 0){
|
|
|
for($i=0;$i<count($coal_list);$i++){
|
|
|
- $id = $coal_list[$i]->ID;
|
|
|
- $risk_list = $risk_list_list[$id] ?? null;
|
|
|
+ $risk_list = DB::connection('mysql_fwe10')
|
|
|
+ ->table('uf_xx_risk_assignment as t')
|
|
|
+ ->whereDate('create_time', $date)
|
|
|
+ ->where('IS_DELETE', 0)
|
|
|
+ ->where('coal_washery_id',$coal_list[$i]->ID)
|
|
|
+ ->where('wcqk',0)
|
|
|
+ ->where('t.is_delete',0)
|
|
|
+ ->where('t.delete_type',0)
|
|
|
+ ->where('t.current_step','结束节点')
|
|
|
+ ->whereNotNull('t.flow_id')
|
|
|
+ ->orderBy('create_time')->get();
|
|
|
+// $id = $coal_list[$i]->ID;
|
|
|
+// $risk_list = $risk_list_list[$id] ?? null;
|
|
|
if(count($risk_list) > 0){
|
|
|
$gao = 0;
|
|
|
$zhong = 0;
|