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