Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#2009 filter grant dashboard to exclude trashed contacts #18428

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CRM/Grant/BAO/Grant.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
*/
public static function getGrantSummary($admin = FALSE) {
$query = "
SELECT status_id, count(id) as status_total
FROM civicrm_grant GROUP BY status_id";
SELECT status_id, count(g.id) as status_total
FROM civicrm_grant g
JOIN civicrm_contact c
ON g.contact_id = c.id
WHERE c.is_deleted = 0
GROUP BY status_id
";

$dao = CRM_Core_DAO::executeQuery($query);

Expand Down