wzq 5 年之前
父節點
當前提交
592feb7640
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Repositories/BeanRepository.php

+ 2 - 2
app/Repositories/BeanRepository.php

@@ -223,11 +223,11 @@ class BeanRepository
             if ($post){
             if ($post){
                 $created_at = $post_detail->created_at;
                 $created_at = $post_detail->created_at;
                 $post->created_time = Carbon::parse($created_at)->diffForHumans();
                 $post->created_time = Carbon::parse($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;