|
@@ -3557,7 +3557,8 @@ class CameraApiController extends BaseController
|
|
|
//导出摄像头表
|
|
|
public function export2Camera(Request $request){
|
|
|
$params = $request->all();
|
|
|
- $result['camera_list'] = [];
|
|
|
+// $result['camera_list'] = [];
|
|
|
+ $camera_list = [];
|
|
|
$index = 0;
|
|
|
|
|
|
if(isset($params['date'])){
|
|
@@ -3600,7 +3601,7 @@ class CameraApiController extends BaseController
|
|
|
$risk = $risk_dict[$value->ID];
|
|
|
foreach ($risk as $k => $v) {
|
|
|
$index++;
|
|
|
- $result['camera_list'][] = [
|
|
|
+ array_push($camera_list,[
|
|
|
'area'=>$value->area_title,
|
|
|
'unit'=>$value->title,
|
|
|
'index'=>$index,
|
|
@@ -3608,13 +3609,47 @@ class CameraApiController extends BaseController
|
|
|
'content'=>$v->risk_name,
|
|
|
'work_location'=>$v->risk_location,
|
|
|
'leader'=>$v->work_people,
|
|
|
- ];
|
|
|
+ ]);
|
|
|
+// $result['camera_list'][] = [
|
|
|
+// 'area'=>$value->area_title,
|
|
|
+// 'unit'=>$value->title,
|
|
|
+// 'index'=>$index,
|
|
|
+// 'people_num'=>$v->work_num,
|
|
|
+// 'content'=>$v->risk_name,
|
|
|
+// 'work_location'=>$v->risk_location,
|
|
|
+// 'leader'=>$v->work_people,
|
|
|
+// ];
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
echo $e->getMessage();
|
|
|
}
|
|
|
}
|
|
|
+ $result_list = [];
|
|
|
+
|
|
|
+ if(isset($params['mark'])){
|
|
|
+ $mark = $params['mark'];
|
|
|
+ if ($mark == 0){
|
|
|
+ foreach ($camera_list as $item) {
|
|
|
+ if ($item["area"] == "宁东片区") {
|
|
|
+ $result_list[] = $item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $result['type_list'] = $result_list;
|
|
|
+ }elseif ($mark == 1){
|
|
|
+ foreach ($camera_list as $item) {
|
|
|
+ if ($item["area"] == "太西片区") {
|
|
|
+ $result_list[] = $item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $result['camera_list'] = $result_list;
|
|
|
+ }else{
|
|
|
+ $result['camera_list'] = $type_list;
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ $result['camera_list'] = $camera_list;
|
|
|
+ }
|
|
|
return $result;
|
|
|
}
|
|
|
|