评论数量,
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user