1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02:00

Fix flag count queries

This commit is contained in:
Toby Zerner
2015-10-31 14:49:44 +10:30
parent 0ec3b0aabb
commit c39f4f01ea

View File

@@ -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');
}
}