Only count confirmed subscriptions for statistics

master
Sven Slootweg 12 years ago
parent fa7f0c2247
commit 97797e5592

@ -168,7 +168,7 @@ class Campaign extends CPHPDatabaseRecordClass
/* Update past-month subscription count */
if($result = $database->CachedQuery("SELECT COUNT(*) FROM log_entries WHERE `CampaignId` = :CampaignId AND `Type` = :Type AND `Date` > DATE_SUB(NOW(), INTERVAL 1 MONTH)",
array(":CampaignId" => $this->sId, ":Type" => LogEntry::SUBSCRIPTION)))
array(":CampaignId" => $this->sId, ":Type" => LogEntry::SUBSCRIPTION_CONFIRMED)))
{
$this->uPastMonthSubscriptions = $result->data[0]["COUNT(*)"];
}

@ -42,4 +42,5 @@ class LogEntry extends CPHPDatabaseRecordClass
const DONATION_ASKED = 3;
const DONATION_MADE = 4;
const UNSUBSCRIPTION = 5;
const SUBSCRIPTION_CONFIRMED = 6;
}

Loading…
Cancel
Save