|
@@ -34,13 +34,10 @@ class SuggestTransformer extends TransformerAbstract
|
|
|
$comment = [];
|
|
|
$comments = PostComment::where('post_id', $post['id'])->where('parent_id', 0)->orderBy('id', 'desc')->limit(2)->get();
|
|
|
foreach($comments as $item){
|
|
|
- $replyCount = $item->reply->count();
|
|
|
$comment[] = [
|
|
|
'id' => $item->id,
|
|
|
'username' => subtext($item->username, 10),
|
|
|
'content' => $item->content,
|
|
|
- 'reply_count' => $replyCount,
|
|
|
- 'reply' => [],
|
|
|
];
|
|
|
}
|
|
|
$topic = [];
|