浏览代码

风险作业导出接口

任敬轩 7 月之前
父节点
当前提交
4446eaf0dc
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Modules/Camera/Http/Controllers/Api/CameraApiController.php

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

@@ -3018,7 +3018,10 @@ class CameraApiController extends BaseController
             $date = date('Y-m-d');
         }
 
-        $coal_list = DB::connection('mysql_fwe10')->table('uf_xx_coal_washery')->where('is_delete',0)->orderBy('sort')->get();
+        $coal_list = DB::connection('mysql_fwe10')->table('uf_xx_coal_washery')
+            ->select('uf_xx_coal_washery.*','uf_xx_area.title as area_title')
+            ->leftJoin('uf_xx_area','uf_xx_area.id','=','uf_xx_coal_washery.area_id')
+            ->where('uf_xx_coal_washery.is_delete',0)->orderBy('uf_xx_area.create_time')->orderBy('uf_xx_coal_washery.sort')->get();
 
         for($i=0;$i<count($type_list);$i++){
             for($j=0;$j<count($coal_list);$j++){
@@ -3056,6 +3059,7 @@ class CameraApiController extends BaseController
                     for($x=0;$x<count($risk_zhong_list);$x++){
                         $index++;
                         array_push($result['type_list'],[
+                            'area'=>$coal_list[$j]->area_title,
                             'index'=>$index,
                             'risk_type'=>$type_list[$i],
                             'risk_level'=>$risk_level,