job,挖矿收益计算

This commit is contained in:
chaosBreaking
2019-09-29 12:59:34 +08:00
parent d15ef1bf7e
commit fc383be299
3 changed files with 91 additions and 76 deletions

View File

@@ -231,7 +231,7 @@ module.exports = {
const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } });
// 计算昨日收益
let revenueLastday = calRevenueLastday(actions);
// 筛选有效矿晶
// 筛选有效矿晶
let activeFund = getActiveFund(fund.fundList);
return res.json({
code: 0,
@@ -241,7 +241,7 @@ module.exports = {
basic: {
activeFund,
revenueLastday,
revenueAll: fund.asset && fund.asset['vic']
revenueAll: fund.asset && +fund.asset['vic'] - +fund.asset['usdt'] // 总金额 - 社区奖励 = 挖矿奖励
}
}
});
@@ -262,7 +262,7 @@ module.exports = {
basic: {
activeFund, //有效矿晶
revenueLastday, // 昨日收益
revenueAll: newFund.asset['vic'] // 累计总收益
revenueAll: +newFund.asset['vic'] - +newFund.asset['usdt'] // 累计总收益 - 社区奖励 = 挖矿奖励
}
}
});
@@ -297,7 +297,7 @@ module.exports = {
data: {
activeFund,
revenueLastday,
revenueAll: fund.asset && fund.asset['vic']
revenueAll: fund.asset && +fund.asset['vic'] - +fund.asset['usdt'] // 总金额 - 社区奖励 = 挖矿奖励
}
});
}).catch(err => {