|
@ -44,7 +44,7 @@ class DashboardService extends SiteService { |
|
|
this.log.info('generating resource visit stats report', { resourceId }); |
|
|
this.log.info('generating resource visit stats report', { resourceId }); |
|
|
|
|
|
|
|
|
const END_DATE = new Date(); |
|
|
const END_DATE = new Date(); |
|
|
const START_DATE = moment(END_DATE).subtract(7, 'day').toDate(); |
|
|
const START_DATE = moment(END_DATE).subtract(3, 'day').toDate(); |
|
|
|
|
|
|
|
|
stats = await ResourceVisit.aggregate([ |
|
|
stats = await ResourceVisit.aggregate([ |
|
|
{ |
|
|
{ |
|
@ -115,7 +115,7 @@ class DashboardService extends SiteService { |
|
|
this.log.info('generating resource country stats report', { resourceId }); |
|
|
this.log.info('generating resource country stats report', { resourceId }); |
|
|
|
|
|
|
|
|
const END_DATE = new Date(); |
|
|
const END_DATE = new Date(); |
|
|
const START_DATE = moment(END_DATE).subtract(7, 'day').toDate(); |
|
|
const START_DATE = moment(END_DATE).subtract(3, 'day').toDate(); |
|
|
|
|
|
|
|
|
stats = await ResourceVisit.aggregate([ |
|
|
stats = await ResourceVisit.aggregate([ |
|
|
{ |
|
|
{ |
|
@ -179,7 +179,7 @@ class DashboardService extends SiteService { |
|
|
this.log.info('generating resource city stats report', { resourceId }); |
|
|
this.log.info('generating resource city stats report', { resourceId }); |
|
|
|
|
|
|
|
|
const END_DATE = new Date(); |
|
|
const END_DATE = new Date(); |
|
|
const START_DATE = moment(END_DATE).subtract(7, 'day').toDate(); |
|
|
const START_DATE = moment(END_DATE).subtract(3, 'day').toDate(); |
|
|
|
|
|
|
|
|
stats = await ResourceVisit.aggregate([ |
|
|
stats = await ResourceVisit.aggregate([ |
|
|
{ |
|
|
{ |
|
@ -244,7 +244,7 @@ class DashboardService extends SiteService { |
|
|
this.log.info('generating user visit stats report', { userId: user._id }); |
|
|
this.log.info('generating user visit stats report', { userId: user._id }); |
|
|
|
|
|
|
|
|
const END_DATE = new Date(); |
|
|
const END_DATE = new Date(); |
|
|
const START_DATE = moment(END_DATE).subtract(7, 'day').toDate(); |
|
|
const START_DATE = moment(END_DATE).subtract(3, 'day').toDate(); |
|
|
|
|
|
|
|
|
const links = await Link.find({ user: user._id }).lean(); |
|
|
const links = await Link.find({ user: user._id }).lean(); |
|
|
const linkIds = links.map((link) => link._id); |
|
|
const linkIds = links.map((link) => link._id); |
|
@ -318,7 +318,7 @@ class DashboardService extends SiteService { |
|
|
this.log.info('generating user country stats report', { userId: user._id }); |
|
|
this.log.info('generating user country stats report', { userId: user._id }); |
|
|
|
|
|
|
|
|
const END_DATE = new Date(); |
|
|
const END_DATE = new Date(); |
|
|
const START_DATE = moment(END_DATE).subtract(7, 'day').toDate(); |
|
|
const START_DATE = moment(END_DATE).subtract(3, 'day').toDate(); |
|
|
|
|
|
|
|
|
const links = await Link.find({ user: user._id }).lean(); |
|
|
const links = await Link.find({ user: user._id }).lean(); |
|
|
const linkIds = links.map((link) => link._id); |
|
|
const linkIds = links.map((link) => link._id); |
|
@ -385,7 +385,7 @@ class DashboardService extends SiteService { |
|
|
this.log.info('generating user city stats report', { userId: user._id }); |
|
|
this.log.info('generating user city stats report', { userId: user._id }); |
|
|
|
|
|
|
|
|
const END_DATE = new Date(); |
|
|
const END_DATE = new Date(); |
|
|
const START_DATE = moment(END_DATE).subtract(7, 'day').toDate(); |
|
|
const START_DATE = moment(END_DATE).subtract(3, 'day').toDate(); |
|
|
|
|
|
|
|
|
const links = await Link.find({ user: user._id }).lean(); |
|
|
const links = await Link.find({ user: user._id }).lean(); |
|
|
const linkIds = links.map((link) => link._id); |
|
|
const linkIds = links.map((link) => link._id); |
|
|