feat: show avatars in my comments
This commit is contained in:
@@ -358,7 +358,11 @@ class CommunityController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
$currentUser = User::field('id,nickname,avatar')->where('id', $this->userId)->findOrEmpty();
|
||||
$currentUserData = $currentUser->isEmpty() ? null : $currentUser->toArray();
|
||||
|
||||
foreach ($list as &$item) {
|
||||
$item['user'] = $currentUserData;
|
||||
$post = $postMap[$item['post_id']] ?? null;
|
||||
$item['post'] = $post && (int) $post['status'] === 1 ? [
|
||||
'id' => $post['id'],
|
||||
|
||||
Reference in New Issue
Block a user