Fix jauge : filtrer les plans Donorbox par campagne cible uniquement
All checks were successful
Deploy / Deploy to Production (push) Successful in 10s
All checks were successful
Deploy / Deploy to Production (push) Successful in 10s
Le proxy comptait les plans actifs de toutes les campagnes du compte, gonflant artificiellement le chiffre affiché. Ajout du filtre campaign_id sur l'endpoint /api/v1/plans et suppression du cache périmé. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
39edd4829a
commit
8a39475338
2 changed files with 4 additions and 17 deletions
15
api/cache/donorbox_data.json
vendored
15
api/cache/donorbox_data.json
vendored
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"total_raised": "37001.02",
|
|
||||||
"goal_amt": "0.0",
|
|
||||||
"currency": "eur",
|
|
||||||
"donations_count": 621,
|
|
||||||
"recurring_donors_count": 76,
|
|
||||||
"campaign_name": "Rejoignez les Soutiens d'Index",
|
|
||||||
"updated_at": "2026-04-22T08:38:57+00:00",
|
|
||||||
"plans_detail": {
|
|
||||||
"active|monthly": 76,
|
|
||||||
"cancelled|monthly": 37,
|
|
||||||
"failed|monthly": 20,
|
|
||||||
"paused|monthly": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -128,11 +128,13 @@ if ($campaign === null) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compter tous les donateurs réguliers actifs (toutes campagnes confondues)
|
// Compter les donateurs réguliers actifs de la campagne ciblée uniquement
|
||||||
|
$campaign_id = $campaign['id'] ?? null;
|
||||||
$recurring_count = 0;
|
$recurring_count = 0;
|
||||||
$plans_page = 1;
|
$plans_page = 1;
|
||||||
do {
|
do {
|
||||||
$plans_url = 'https://donorbox.org/api/v1/plans?per_page=100&page=' . $plans_page;
|
$plans_url = 'https://donorbox.org/api/v1/plans?per_page=100&page=' . $plans_page
|
||||||
|
. ($campaign_id ? '&campaign_id=' . urlencode($campaign_id) : '');
|
||||||
|
|
||||||
$ch_plans = curl_init();
|
$ch_plans = curl_init();
|
||||||
curl_setopt_array($ch_plans, [
|
curl_setopt_array($ch_plans, [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue