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