|
|
|
@ -446,7 +446,6 @@ class Posts extends BaseController |
|
|
|
if ($reply_user_id != $this->uid) { |
|
|
|
PostsNotice::optionNotice($posts_id, $id, $reply_user_id); |
|
|
|
// 向作者好友推送新的消息 |
|
|
|
$this->wsSendMsg($this->uid, $id, 'postsLikes'); |
|
|
|
$this->wsSendMsg($reply_user_id, 0, 'postsNotice'); |
|
|
|
} |
|
|
|
|
|
|
|
@ -525,7 +524,6 @@ class Posts extends BaseController |
|
|
|
} |
|
|
|
if ($reply_user_id != $this->uid) { |
|
|
|
PostsNotice::optionNotice($posts_id, $id, $reply_user_id, 2); |
|
|
|
$this->wsSendMsg($this->uid, $id); |
|
|
|
$this->wsSendMsg($reply_user_id, 0, 'postsNotice'); |
|
|
|
} |
|
|
|
return success(lang('system.success')); |
|
|
|
@ -570,7 +568,7 @@ class Posts extends BaseController |
|
|
|
['user_id', '=', $this->uid] |
|
|
|
]; |
|
|
|
$field = '*'; |
|
|
|
$order = 'create_time desc'; |
|
|
|
$order = 'is_read asc'; |
|
|
|
|
|
|
|
$list = $this->paginate($model->where($where)->field($field)->order($order)); |
|
|
|
$data = []; |
|
|
|
@ -598,10 +596,37 @@ class Posts extends BaseController |
|
|
|
if (!$item['is_read']) { |
|
|
|
PostsNotice::read($item['id']); |
|
|
|
} |
|
|
|
if ($item['type'] == 2) { |
|
|
|
$commentWhere = [ |
|
|
|
'id' => $item['relevance_id'], |
|
|
|
'delete_time' => 0, |
|
|
|
'type' => 1 |
|
|
|
]; |
|
|
|
$comment = Comment::where($commentWhere)->field('content,reply_user_id,user_id')->find(); |
|
|
|
$item['content'] = $comment['content'] ?? lang('posts.comment_del'); |
|
|
|
$item['reply_user'] = []; |
|
|
|
$item['option_user'] = []; |
|
|
|
if ($comment['reply_user_id']) { |
|
|
|
$item['reply_user'] = $this->getFriendUserInfo($comment['reply_user_id']); |
|
|
|
} |
|
|
|
if ($comment['user_id']) { |
|
|
|
$item['option_user'] = $this->getFriendUserInfo($comment['user_id']); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($item['type'] == 1) { |
|
|
|
$likesWhere = [ |
|
|
|
'id' => $item['relevance_id'], |
|
|
|
'type' => 1 |
|
|
|
]; |
|
|
|
$Likes = Likes::where($likesWhere)->field('user_id')->find(); |
|
|
|
if ($Likes['user_id']) { |
|
|
|
$item['option_user'] = $this->getFriendUserInfo($Likes['user_id']); |
|
|
|
} |
|
|
|
} |
|
|
|
// 用户信息 |
|
|
|
$item['user'] = $this->getFriendUserInfo($item['user_id']); |
|
|
|
// 评论回复 |
|
|
|
unset($item['is_read']); |
|
|
|
//unset($item['is_read']); |
|
|
|
} |
|
|
|
} |
|
|
|
return success('', $data,$list->total(),$list->currentPage()); |
|
|
|
|