From d15ef1bf7ee5ef89c4dcd4b46dc3c0bf4f67f156 Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Sun, 29 Sep 2019 12:29:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=98=A8=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/fund/fund.controller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/fund/fund.controller.js b/src/modules/fund/fund.controller.js index a20bae8..6ca6ce3 100644 --- a/src/modules/fund/fund.controller.js +++ b/src/modules/fund/fund.controller.js @@ -224,9 +224,11 @@ module.exports = { data: fund.fundList }); const { hasNew, list } = await fund.hasNewDeposit(); + const [ start, end ] = getDate(1); + let now = new Date(); if (!hasNew) { - const [ start, end ] = getDate(1); - const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: end } }); + // const [ start, end ] = getDate(1); + const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } }); // 计算昨日收益 let revenueLastday = calRevenueLastday(actions); // 筛选有效矿晶 @@ -244,8 +246,6 @@ module.exports = { } }); } - const [ start, end ] = getDate(1); - let now = new Date(); const [newFund, actions] = await Promise.all([ fund.addFund(list, { inviter }), Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } })