zhangchangchun лет назад: 5
Родитель
Сommit
8940abc910
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      app/Repositories/FeedRepositories.php

+ 4 - 4
app/Repositories/FeedRepositories.php

@@ -120,7 +120,7 @@ class FeedRepositories
             foreach ($data as &$value){
                 if($value['type'] == 6){
                     $post = $this->postRepositories->detail($value['relate_id']);
-                    $value['relate_data'] = $this->postDetail($post);
+                    $value['relate_data'] = $this->postDetail($post,$value['follow_uid']);
                 }
                 if($value['type'] == 5){
                     $value['content'] = null;
@@ -131,7 +131,7 @@ class FeedRepositories
         }
         return $data;
     }
-    public function postDetail($post){
+    public function postDetail($post,$follow_uid){
         $token =  JWTAuth::decode(JWTAuth::getToken());
         $uid = $token['user']->uid;
         $imgs = [];
@@ -147,7 +147,7 @@ class FeedRepositories
             ];
         }
         $isFollow = 0;
-        $followStatus = $this->getFollowStatus($uid, $post['follow_uid']);
+        $followStatus = $this->getFollowStatus($uid, $follow_uid);
         if($followStatus){
             $isFollow = $followStatus;
         }
@@ -174,7 +174,7 @@ class FeedRepositories
             'is_like' => PostLike::where('post_id', $post['id'])->where('uid', $uid)->exists()?1:0,
             'is_dislike' => PostDislike::where('post_id', $post['id'])->where('uid', $uid)->exists()?1:0,
             'is_collect' => PostCollect::where('post_id', $post['id'])->where('uid', $uid)->exists()?1:0,
-            'is_follow' => $isFollow,
+            'follow_status' => $isFollow,
         ];
     }
     public function getPostComment($post_id){