fix: 刷新
This commit is contained in:
@@ -210,11 +210,26 @@ module.exports = {
|
||||
data: fund.fundList
|
||||
});
|
||||
const { hasNew, list } = fund.hasNewDeposit();
|
||||
if (!hasNew) return res.json({
|
||||
if (!hasNew) {
|
||||
const [ start, end ] = getDate(1);
|
||||
const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: end } });
|
||||
// 计算昨日收益
|
||||
let revenueLastday = calRevenueLastday(actions);
|
||||
// 筛选有效矿晶
|
||||
let activeFund = getActiveFund(fund.fundList);
|
||||
return res.json({
|
||||
code: 0,
|
||||
msg: '刷新成功',
|
||||
data: {}
|
||||
data: {
|
||||
list: fund.fundList,
|
||||
basic: {
|
||||
activeFund,
|
||||
revenueLastday,
|
||||
revenueAll: fund.fundSum
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const [ start, end ] = getDate(1);
|
||||
const [newFund, actions] = await Promise.all([
|
||||
fund.addFund(list, { inviter }),
|
||||
|
||||
Reference in New Issue
Block a user