Explorar el Código

风险作业接口修改

任敬轩 hace 8 meses
padre
commit
1a0a30e243
Se han modificado 1 ficheros con 7 adiciones y 5 borrados
  1. 7 5
      Modules/Camera/Http/Controllers/Api/CameraApiController.php

+ 7 - 5
Modules/Camera/Http/Controllers/Api/CameraApiController.php

@@ -2248,11 +2248,13 @@ class CameraApiController extends BaseController
                         ]
                     ];
                 }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();
+                    array_push($result['other_data'],[
+                        'title'=> $coal_washery[$i]->title,
+                        'id'   => $coal_washery[$i]->ID,
+                        '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(),
+                        '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(),
+                        '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()
+                    ]);
                 }
             }
         }