diff --git a/src/Goteo/Controller/Dashboard/ProjectDashboardController.php b/src/Goteo/Controller/Dashboard/ProjectDashboardController.php index 6621af8070..59467a612d 100644 --- a/src/Goteo/Controller/Dashboard/ProjectDashboardController.php +++ b/src/Goteo/Controller/Dashboard/ProjectDashboardController.php @@ -436,7 +436,7 @@ public function updatesPrivacyAction(Request $request, string $pid, string $uid) $post = BlogPost::getBySlug($uid); - $filters = ['post' => $post->id]; + $filters = ['post_id' => $post->id]; $total = PostRewardAccess::count($filters); $postRewardAccessList = PostRewardAccess::getList($filters, 0, $total); diff --git a/src/Goteo/Library/PostPrivacyAccess.php b/src/Goteo/Library/PostPrivacyAccess.php index c2eaa2be36..cb0632d34b 100644 --- a/src/Goteo/Library/PostPrivacyAccess.php +++ b/src/Goteo/Library/PostPrivacyAccess.php @@ -39,4 +39,13 @@ private function canUserAccess(User $user, Post $post): bool return false; } + + /** + * @return PostRewardAccess[] + */ + public function getLimitingRewardsForPost(Post $post): array + { + $postRewardsCount = PostRewardAccess::count(['post_id' => $post->id]); + return PostRewardAccess::getList(['post_id' => $post->id], 0, $postRewardsCount); + } }