mirror of
https://github.com/flarum/core.git
synced 2025-07-20 16:21:18 +02:00
fixes #1695, take into consideration is_private with counts on User stats
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user