|
@@ -157,7 +157,7 @@ class FeedRepositories
|
|
|
if ($data) {
|
|
|
foreach ($data as $key => &$value) {
|
|
|
if ($value['type'] == 6) {
|
|
|
- $post = $this->postRepositories->detail($value['relate_id']);
|
|
|
+ $post = $this->getPostInfo($value['relate_id'], 1);
|
|
|
if ($post) {
|
|
|
$value['relate_data'] = $this->postDetail($post, $value['follow_uid'], $userInfo);
|
|
|
} else {
|
|
@@ -184,45 +184,43 @@ class FeedRepositories
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
- public function postDetail($post, $follow_uid, $userInfo)
|
|
|
+ public function postDetail($postInfo, $follow_uid, $userInfo)
|
|
|
{
|
|
|
- Log::debug('feed流内容--' . json_encode($post));
|
|
|
+ Log::debug('feed流内容--' . json_encode($postInfo));
|
|
|
$uid = $userInfo['uid'];
|
|
|
- $postInfo = $this->getPostInfo($post['id']);
|
|
|
-
|
|
|
$isFollow = 0;
|
|
|
Log::debug("内容feed关注uid{$uid}followUid{$follow_uid}");
|
|
|
$followStatus = $this->getFollowStatus($uid, $follow_uid);
|
|
|
if ($followStatus) {
|
|
|
$isFollow = $followStatus;
|
|
|
}
|
|
|
- $user = $this->userInfo($post['uid']);
|
|
|
+ $user = $this->userInfo($postInfo['uid']);
|
|
|
return [
|
|
|
- 'id' => $post['id'],
|
|
|
- 'type' => $post['type'],
|
|
|
- 'created_at' => Carbon::parse($post['created_at'])->diffForHumans(),
|
|
|
- 'uid' => $post['uid'],
|
|
|
+ 'id' => (int) $postInfo['id'],
|
|
|
+ 'type' => $postInfo['type'],
|
|
|
+ 'created_at' => Carbon::parse($postInfo['created_at'])->diffForHumans(),
|
|
|
+ 'uid' => (int) $postInfo['uid'],
|
|
|
'username' => $user['username'],
|
|
|
'avatar' => $user['avatar'],
|
|
|
- 'topic' => $this->getTopic($post['topic_ids']),
|
|
|
- 'title' => $post['title'],
|
|
|
- 'content' => $post['content'],
|
|
|
- 'location' => $post['location'],
|
|
|
- 'img' => $post['img'],
|
|
|
+ 'topic' => $this->getTopic($postInfo['topic_ids']),
|
|
|
+ 'title' => $postInfo['title'],
|
|
|
+ 'content' => $postInfo['content'],
|
|
|
+ 'location' => $postInfo['location'],
|
|
|
+ 'img' => $postInfo['img'],
|
|
|
'imgs' => $postInfo['imgs'],
|
|
|
- 'video' => $post['video'],
|
|
|
+ 'video' => $postInfo['video'],
|
|
|
'pv' => getNumber($postInfo['pv']),
|
|
|
'praise_count' => $postInfo['praise_count'],
|
|
|
'comment_count' => $postInfo['comment_count'],
|
|
|
'available_bean' => $postInfo['available_bean'],
|
|
|
'will_collect_bean' => $postInfo['will_collect_bean'],
|
|
|
- 'post_comment' => $this->getNewComment($post['id']),
|
|
|
- 'is_like' => Redis::SISMEMBER('post_like_'.$post['id'], $uid),
|
|
|
- 'is_dislike' => Redis::SISMEMBER('post_unlike_'.$post['id'], $uid),
|
|
|
- 'is_collect' => Redis::SISMEMBER('post_collect_'.$post['id'], $uid),
|
|
|
+ 'post_comment' => $this->getNewComment($postInfo['id']),
|
|
|
+ 'is_like' => Redis::SISMEMBER('post_like_'.$postInfo['id'], $uid),
|
|
|
+ 'is_dislike' => Redis::SISMEMBER('post_unlike_'.$postInfo['id'], $uid),
|
|
|
+ 'is_collect' => Redis::SISMEMBER('post_collect_'.$postInfo['id'], $uid),
|
|
|
'follow_status' => $isFollow,
|
|
|
- 'h5url' => config('customer.share_post_h5url') . "?post_id={$post['id']}&invite_code={$userInfo['invite_code']}",
|
|
|
- 'desc_url' => $post['type'] == 'html' ? config('customer.app_service_url') . '/community/fragment/detail/' . $post['id'] : '',
|
|
|
+ 'h5url' => config('customer.share_post_h5url') . "?post_id={$postInfo['id']}&invite_code={$userInfo['invite_code']}",
|
|
|
+ 'desc_url' => $postInfo['type'] == 'html' ? config('customer.app_service_url') . '/community/fragment/detail/' . $postInfo['id'] : '',
|
|
|
];
|
|
|
}
|
|
|
|