mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 21:38:05 +02:00
81 lines
2.3 KiB
PHP
81 lines
2.3 KiB
PHP
<?php
|
|
use CRM_Contactcats_ExtensionUtil as E;
|
|
|
|
return [
|
|
[
|
|
'name' => 'SavedSearch_ContactCategories_Locus_3_5',
|
|
'entity' => 'SavedSearch',
|
|
'cleanup' => 'unused',
|
|
'update' => 'unmodified',
|
|
'params' => [
|
|
'version' => 4,
|
|
'values' => [
|
|
'name' => 'ContactCategories_Locus_3_5',
|
|
'label' => E::ts('ContactCategories Locus 3.5'),
|
|
'api_entity' => 'Contact',
|
|
'api_params' => [
|
|
'version' => 4,
|
|
'select' => [
|
|
'id',
|
|
'COUNT(Contact_Contribution_contact_id_01.id) AS COUNT_Contact_Contribution_contact_id_01_id',
|
|
'SUM(Contact_Contribution_contact_id_01.total_amount) AS SUM_Contact_Contribution_contact_id_01_total_amount',
|
|
'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount',
|
|
],
|
|
'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.receive_date',
|
|
'>=',
|
|
'"now - 24 month"',
|
|
],
|
|
[
|
|
'Contact_Contribution_contact_id_01.contribution_status_id:name',
|
|
'=',
|
|
'"Completed"',
|
|
],
|
|
[
|
|
'Contact_Contribution_contact_id_01.is_test',
|
|
'=',
|
|
FALSE,
|
|
],
|
|
],
|
|
],
|
|
'having' => [
|
|
[
|
|
'COUNT_Contact_Contribution_contact_id_01_id',
|
|
'>=',
|
|
3,
|
|
],
|
|
[
|
|
'OR',
|
|
[
|
|
[
|
|
'MAX_Contact_Contribution_contact_id_01_total_amount',
|
|
'>=',
|
|
NULL,
|
|
],
|
|
[
|
|
'SUM_Contact_Contribution_contact_id_01_total_amount',
|
|
'>=',
|
|
NULL,
|
|
],
|
|
],
|
|
],
|
|
],
|
|
],
|
|
'description' => E::ts('Multiple time major donors.'),
|
|
],
|
|
'match' => ['name'],
|
|
],
|
|
],
|
|
];
|