|
@@ -682,7 +682,12 @@ class PostRepositories
|
|
|
*/
|
|
|
public function getCommentCount($id)
|
|
|
{
|
|
|
- return $this->postComment->where('post_id', $id)->count();
|
|
|
+ $commentCount = 0;
|
|
|
+ $post = $this->post->find($id);
|
|
|
+ if($post){
|
|
|
+ $commentCount = $post->data->comment_count;
|
|
|
+ }
|
|
|
+ return $commentCount;
|
|
|
}
|
|
|
|
|
|
}
|