mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:39:40 +08:00
Fix flag count queries
This commit is contained in:
parent
0ec3b0aabb
commit
c39f4f01ea
@ -81,7 +81,7 @@ class AddFlagsApi
|
||||
*/
|
||||
protected function getFlagsCount(User $actor)
|
||||
{
|
||||
return Flag::whereVisibleTo($actor)->distinct('flags.post_id')->count();
|
||||
return Flag::whereVisibleTo($actor)->distinct()->count('flags.post_id');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,6 +96,6 @@ class AddFlagsApi
|
||||
$query->where('flags.time', '>', $time);
|
||||
}
|
||||
|
||||
return $query->distinct('flags.post_id')->count();
|
||||
return $query->distinct()->count('flags.post_id');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user