duqinya 5 years ago
parent
commit
2e7cde575f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/Repositories/BeanRepository.php

+ 2 - 2
app/Repositories/BeanRepository.php

@@ -222,11 +222,11 @@ class BeanRepository
                 ->find($request['post_id']);
                 ->find($request['post_id']);
             if ($post){
             if ($post){
                 $post->created_time = Carbon::parse($post->created_at)->diffForHumans();
                 $post->created_time = Carbon::parse($post->created_at)->diffForHumans();
-                $post_imgs = $post->imgs;
                 $imgs = [];
                 $imgs = [];
-                foreach($post_imgs as $img){
+                foreach($post->imgs as $img){
                     $imgs[] = $img['img'];
                     $imgs[] = $img['img'];
                 }
                 }
+                unset($post->imgs);
                 $post->imgs = $imgs;
                 $post->imgs = $imgs;
                 $post->topic = $post->topic();
                 $post->topic = $post->topic();
                 $star_detail['post'] = $post;
                 $star_detail['post'] = $post;