评论数量,

This commit is contained in:
2025-11-28 11:19:20 +08:00
parent bf18a31d5f
commit 1c9ffc6d13
4 changed files with 58 additions and 1 deletions
@@ -68,6 +68,10 @@ class PostCommentService
$config['where']['root_id'] = $p['parent_id'];
}
// 根评论ID
if (isset($p['received_id']) && !empty($p['received_id'])) {
$config['where']['id'] = ['not in', $p['parent_id']];
}
// 根评论ID
if (isset($p['status']) && !empty($p['status'])) {
$config['where']['status'] = $p['status'];
}
@@ -100,6 +104,9 @@ class PostCommentService
$data['root_id'] = 0;
if(!empty($data['parent_id'])){
$data['root_id'] = PostComment::where('id', $data['parent_id'])->value('root_id');
if($data['root_id'] == 0){
$data['root_id'] = $data['parent_id'];
}
}
return $data;