fix: activeFund

This commit is contained in:
chaosBreaking
2019-10-26 17:35:15 +08:00
parent 4688a2fa41
commit 460588a342

View File

@@ -243,7 +243,7 @@ module.exports = {
let revenueLastday = calRevenueLastday(actions);
// 筛选有效矿晶
// let activeFund = getActiveFund(fund.fundList);
let activeFund = fund.fundList;
let activeFund = fund.vicFundSum;
let revenueAll = Array.isArray(allAction) && allAction.reduce((pre, cur) => pre + (+cur.amount || 0), 0) || 0;
revenueAll = revenueAll.toFixed(4);
return res.json({
@@ -267,7 +267,7 @@ module.exports = {
let revenueLastday = calRevenueLastday(actions);
// 筛选有效矿晶
// let activeFund = getActiveFund(fund.fundList);
let activeFund = fund.fundList;
let activeFund = fund.vicFundSum;
if (!newFund || !newFund.fundList) newFund = fund;
let revenueAll = Array.isArray(allAction) && allAction.reduce((pre, cur) => pre + (+cur.amount || 0), 0) || 0;
revenueAll = revenueAll.toFixed(4);
@@ -306,7 +306,7 @@ module.exports = {
let now = new Date();
// 筛选有效矿晶
// let activeFund = getActiveFund(fund.fundList);
let activeFund = fund.fundList;
let activeFund = fund.vicFundSum;
const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } }).exec();
const allAction = await Action.find({ userId, type: 1 }).exec();
// 计算昨日收益