fix:昨日收益
This commit is contained in:
@@ -245,9 +245,10 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const [ start, end ] = getDate(1);
|
const [ start, end ] = getDate(1);
|
||||||
|
let now = new Date();
|
||||||
const [newFund, actions] = await Promise.all([
|
const [newFund, actions] = await Promise.all([
|
||||||
fund.addFund(list, { inviter }),
|
fund.addFund(list, { inviter }),
|
||||||
Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: end } })
|
Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } })
|
||||||
]);
|
]);
|
||||||
// 计算昨日收益
|
// 计算昨日收益
|
||||||
let revenueLastday = calRevenueLastday(actions);
|
let revenueLastday = calRevenueLastday(actions);
|
||||||
@@ -285,7 +286,8 @@ module.exports = {
|
|||||||
const { userId } = res.locals.user;
|
const { userId } = res.locals.user;
|
||||||
return Fund.findOne({userId}).then(async fund => {
|
return Fund.findOne({userId}).then(async fund => {
|
||||||
const [ start, end ] = getDate(1);
|
const [ start, end ] = getDate(1);
|
||||||
const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: end } }).exec();
|
let now = new Date();
|
||||||
|
const actions = await Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } }).exec();
|
||||||
// 计算昨日收益
|
// 计算昨日收益
|
||||||
let revenueLastday = calRevenueLastday(actions);
|
let revenueLastday = calRevenueLastday(actions);
|
||||||
// 筛选有效矿晶
|
// 筛选有效矿晶
|
||||||
|
|||||||
Reference in New Issue
Block a user