contactcats/managed/SavedSearch_ContactCategories_Locus_1_2.mgd.php
Rich Lott / Artful Robot 699436c75b Add managed saved searches
2025-04-01 20:21:50 +01:00

61 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use CRM_Contactcats_ExtensionUtil as E;
return [
[
'name' => 'SavedSearch_ContactCategories_Locus_1_2',
'entity' => 'SavedSearch',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'ContactCategories_Locus_1_2',
'label' => E::ts('ContactCategories Locus 1.2'),
'api_entity' => 'Contact',
'api_params' => [
'version' => 4,
'select' => [
'id',
'sort_name',
'contact_type:label',
'contact_sub_type:label',
'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount',
'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id',
'MAX(Contact_Contribution_contact_id_01.receive_date) AS MAX_Contact_Contribution_contact_id_01_receive_date',
],
'orderBy' => [],
'where' => [],
'groupBy' => ['id'],
'join' => [
[
'Contribution AS Contact_Contribution_contact_id_01',
'INNER',
[
'id',
'=',
'Contact_Contribution_contact_id_01.contact_id',
],
[
'Contact_Contribution_contact_id_01.contribution_status_id:name',
'=',
'"Completed"',
],
],
],
'having' => [
[
'MAX_Contact_Contribution_contact_id_01_receive_date',
'BETWEEN',
['now - 26 month', 'now - 24 month'],
],
],
],
'description' => E::ts('1.2 Occasional donor: critical
last donation 24 36 months before today'),
],
'match' => ['name'],
],
],
];