mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +08:00
fixes #1695, take into consideration is_private with counts on User stats
This commit is contained in:
parent
c881f9f633
commit
3611fa1bb9
|
@ -687,7 +687,10 @@ class User extends AbstractModel
|
|||
*/
|
||||
public function refreshCommentCount()
|
||||
{
|
||||
$this->comment_count = $this->posts()->where('type', 'comment')->count();
|
||||
$this->comment_count = $this->posts()
|
||||
->where('type', 'comment')
|
||||
->where('is_private', false)
|
||||
->count();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -699,7 +702,9 @@ class User extends AbstractModel
|
|||
*/
|
||||
public function refreshDiscussionCount()
|
||||
{
|
||||
$this->discussion_count = $this->discussions()->count();
|
||||
$this->discussion_count = $this->discussions()
|
||||
->where('is_private', false)
|
||||
->count();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user