This commit is contained in:
2025-11-28 11:59:23 +08:00
parent 6f9ee5adef
commit 1101128fb1
@@ -33,9 +33,8 @@ class PostCommentController extends BaseController
if (isset($data['updated_at']))
$data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
if (isset($data['id'])){
$data['child'][] = PostComment::where(['parent_id' => $data['id']])->first();
$child = PostComment::where(['parent_id' => $data['id']])->first();
$data['count'] = PostComment::where(['parent_id' => $data['id']])->count();
$child = $data['child'];
if (isset($child['user_id'])){
$ossservice = new OssService();
$child['user'] = User::where('id', $child['user_id'])->select(['nickname', 'avatar', 'openid'])->first();
@@ -43,7 +42,7 @@ class PostCommentController extends BaseController
$child['user']['avatar_pull'] = $ossservice->generatePrivateUrl($child['user']['avatar']);
}
}
$data['child'] = $child;
$data['child'][] = $child;
}
if (isset($data['user_id'])){
$ossservice = new OssService();