浏览代码

修复上传错误的报错

sandm 3 年之前
父节点
当前提交
f944a67541
共有 1 个文件被更改,包括 28 次插入20 次删除
  1. 28 20
      app/Admin/Controllers/Recruit/RecruitController.php

+ 28 - 20
app/Admin/Controllers/Recruit/RecruitController.php

@@ -744,11 +744,13 @@ class RecruitController extends Controller
                 $data->material = json_decode($data->material);
                 $photo_data = [];
                 foreach ($data->material as $k => $v) {
-                    $photo_data[] = [
-                        'alt' => $v->name,
-                        'pid' => $v->uid,
-                        'src' => $v->response->path,
-                    ];
+                    if($v->status){
+                        $photo_data[] = [
+                            'alt' => $v->name,
+                            'pid' => $v->uid,
+                            'src' => $v->response->path,
+                        ];
+                    }
                 }
                 $photos['material'] = [
                     'title' => '申请加分佐证材料',
@@ -765,11 +767,13 @@ class RecruitController extends Controller
                 $data->identification = json_decode($data->identification);
                 $photo_data = [];
                 foreach ($data->identification as $k => $v) {
-                    $photo_data[] = [
-                        'alt' => $v->name,
-                        'pid' => $v->uid,
-                        'src' => $v->response->path,
-                    ];
+                    if($v->status){
+                        $photo_data[] = [
+                            'alt' => $v->name,
+                            'pid' => $v->uid,
+                            'src' => $v->response->path,
+                        ];
+                    }
                 }
                 $photos['identification'] = [
                     'title' => '身份证明',
@@ -786,11 +790,13 @@ class RecruitController extends Controller
                 $data->education_certification = json_decode($data->education_certification);
                 $photo_data = [];
                 foreach ($data->education_certification as $k => $v) {
-                    $photo_data[] = [
-                        'alt' => $v->name,
-                        'pid' => $v->uid,
-                        'src' => $v->response->path,
-                    ];
+                    if($v->status){
+                        $photo_data[] = [
+                            'alt' => $v->name,
+                            'pid' => $v->uid,
+                            'src' => $v->response->path,
+                        ];
+                    }
                 }
                 $photos['education_certification'] = [
                     'title' => '学历证明',
@@ -807,11 +813,13 @@ class RecruitController extends Controller
                 $data->other_certification = json_decode($data->other_certification);
                 $photo_data = [];
                 foreach ($data->other_certification as $k => $v) {
-                    $photo_data[] = [
-                        'alt' => $v->name,
-                        'pid' => $v->uid,
-                        'src' => $v->response->path,
-                    ];
+                    if($v->status){
+                        $photo_data[] = [
+                            'alt' => $v->name,
+                            'pid' => $v->uid,
+                            'src' => $v->response->path,
+                        ];
+                    }
                 }
                 $photos['other_certification'] = [
                     'title' => '其他证明',