mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 21:48:46 +08:00
fixes #1695, take into consideration is_private with counts on User stats
This commit is contained in:
parent
06cd062a1b
commit
c2586586c4
|
@ -757,7 +757,10 @@ class User extends AbstractModel
|
||||||
*/
|
*/
|
||||||
public function refreshCommentCount()
|
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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -769,7 +772,9 @@ class User extends AbstractModel
|
||||||
*/
|
*/
|
||||||
public function refreshDiscussionCount()
|
public function refreshDiscussionCount()
|
||||||
{
|
{
|
||||||
$this->discussion_count = $this->discussions()->count();
|
$this->discussion_count = $this->discussions()
|
||||||
|
->where('is_private', false)
|
||||||
|
->count();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user