mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 21:38:05 +02:00
50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
||
use CRM_Contactcats_ExtensionUtil as E;
|
||
|
||
return [
|
||
[
|
||
'name' => 'SavedSearch_ContactCategories_Locus_3_1',
|
||
'entity' => 'SavedSearch',
|
||
'cleanup' => 'unused',
|
||
'update' => 'unmodified',
|
||
'params' => [
|
||
'version' => 4,
|
||
'values' => [
|
||
'name' => 'ContactCategories_Locus_3_1',
|
||
'label' => E::ts('ContactCategories Locus 3.1'),
|
||
'api_entity' => 'Contact',
|
||
'api_params' => [
|
||
'version' => 4,
|
||
'select' => [
|
||
'id',
|
||
'MAX(Contact_Contribution_contact_id_01.total_amount) AS MAX_Contact_Contribution_contact_id_01_total_amount',
|
||
'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',
|
||
],
|
||
],
|
||
],
|
||
'having' => [
|
||
['MAX_Contact_Contribution_contact_id_01_total_amount', '>=', '500'],
|
||
['MAX_Contact_Contribution_contact_id_01_receive_date', 'BETWEEN', ['now - 36 month', 'now - 12 month']],
|
||
],
|
||
],
|
||
'description' => E::ts('Major donor: critical
|
||
|
||
- last donation 24 – 36 months before today
|
||
- 1+ donation of 500+ EUR'),
|
||
],
|
||
'match' => ['name'],
|
||
],
|
||
],
|
||
];
|