mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-18 03:23:42 -05:00
Update analytics aggregation script
Giving preference to payments created field over _id date.
This commit is contained in:
parent
e33323e7eb
commit
717377eb43
1 changed files with 7 additions and 1 deletions
|
@ -642,7 +642,13 @@ function getRecurringRevenueCounts(startDay) {
|
||||||
var cursor = db.payments.find({_id: {$gte: startObj}});
|
var cursor = db.payments.find({_id: {$gte: startObj}});
|
||||||
while (cursor.hasNext()) {
|
while (cursor.hasNext()) {
|
||||||
var doc = cursor.next();
|
var doc = cursor.next();
|
||||||
var day = doc._id.getTimestamp().toISOString().substring(0, 10);
|
var day;
|
||||||
|
if (doc.created) {
|
||||||
|
day = doc.created.substring(0, 10);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
day = doc._id.getTimestamp().toISOString().substring(0, 10);
|
||||||
|
}
|
||||||
|
|
||||||
if (doc.service === 'ios' || doc.service === 'bitcoin') continue;
|
if (doc.service === 'ios' || doc.service === 'bitcoin') continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue