Explorar el Código

时间转换成文字

duqinya hace 5 años
padre
commit
96c5719a34
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  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){