Sfoglia il codice sorgente

时间转换成文字

duqinya 5 anni fa
parent
commit
96c5719a34
1 ha cambiato i file con 1 aggiunte e 2 eliminazioni
  1. 1 2
      app/Repositories/BeanRepository.php

+ 1 - 2
app/Repositories/BeanRepository.php

@@ -221,8 +221,7 @@ class BeanRepository
                 ->select('post.*','post_data.pv')
                 ->find($request['post_id']);
             if ($post){
-                $created_at = $post_detail->created_at;
-                $post->created_time = Carbon::parse($created_at)->diffForHumans();
+                $post->created_time = Carbon::parse($post->created_at)->diffForHumans();
                 $post_imgs = $post->imgs;
                 $imgs = [];
                 foreach($post_imgs as $img){