mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 21:48:05 +02:00
66 lines
2 KiB
PHP
66 lines
2 KiB
PHP
<?php
|
||
use CRM_Contactcats_ExtensionUtil as E;
|
||
|
||
return [
|
||
[
|
||
'name' => 'SavedSearch_ContactCategories_Locus_1_3',
|
||
'entity' => 'SavedSearch',
|
||
'cleanup' => 'unused',
|
||
'update' => 'unmodified',
|
||
'params' => [
|
||
'version' => 4,
|
||
'values' => [
|
||
'name' => 'ContactCategories_Locus_1_3',
|
||
'label' => E::ts('ContactCategories Locus 1.3'),
|
||
'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',
|
||
'MIN(Contact_Contribution_contact_id_01.receive_date) AS MIN_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' => [
|
||
[
|
||
'MIN_Contact_Contribution_contact_id_01_receive_date',
|
||
'BETWEEN',
|
||
['now - 24 month', 'now - 12 month'],
|
||
],
|
||
[
|
||
'COUNT_Contact_Contribution_contact_id_01_id',
|
||
'=',
|
||
1,
|
||
],
|
||
],
|
||
],
|
||
'description' => E::ts('1.3 Occasional Donor: one-time
|
||
|
||
- first and only donation 12 – 24 months before today'),
|
||
],
|
||
'match' => ['name'],
|
||
],
|
||
],
|
||
];
|