mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
#47 - Adds functionality to display child comments. Also has some code towards the reply functionality.
This commit is contained in:
@ -38,14 +38,13 @@ class CommentRepo {
|
||||
return $comment;
|
||||
}
|
||||
|
||||
public function getCommentsForPage($pageId, $commentId, $count = 20) {
|
||||
if (empty($commentId)) {
|
||||
// requesting parent comments
|
||||
$query = $this->comment->getParentCommentsByPage($pageId);
|
||||
return $query->paginate($count);
|
||||
} else {
|
||||
// requesting the child comments.
|
||||
return Comment::whereRaw("page_id = $pageId AND parent_id = $commentId")->get();
|
||||
}
|
||||
public function getCommentsForPage($pageId, $commentId, $count = 20) {
|
||||
// requesting parent comments
|
||||
$query = $this->comment->getCommentsByPage($pageId, $commentId);
|
||||
return $query->paginate($count);
|
||||
}
|
||||
|
||||
public function getCommentCount($pageId) {
|
||||
return $this->comment->where('page_id', '=', $pageId)->count();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user