Procházet zdrojové kódy

修复材料数组问题

sandm před 2 roky
rodič
revize
2d229b8e2e

+ 8 - 5
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -414,13 +414,16 @@ class IndexController extends WebBaseController
                     $special = RecruitAppointExpandSpecial::where('recruit_appoint_id',$user_info['id'])->first();
                     if($special){
                         $material = json_decode($special['material'],true);
-                        foreach ($material as $k => $v){
-                            if(array_key_exists('response',$v)){
-                                if(array_key_exists('path',$v['response'])){
-                                    $material[$k]['url'] = $v['response']['path'];}
-
+                        if(is_array($material)){
+                            foreach ($material as $k => $v){
+                                if(array_key_exists('response',$v)){
+                                    if(array_key_exists('path',$v['response'])){
+                                        $material[$k]['url'] = $v['response']['path'];
+                                    }
+                                }
                             }
                         }
+
                     }else{
                         $material = [];
                         $special = [