mirror of
https://github.com/flarum/framework.git
synced 2025-02-06 14:36:15 +08:00
fixes #1695, take into consideration is_private with counts on User stats
This commit is contained in:
parent
6745f55ad7
commit
720c88e73a
|
@ -757,7 +757,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;
|
||||
}
|
||||
|
@ -769,7 +772,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