fix: community

This commit is contained in:
chaosBreaking
2019-10-27 13:52:57 +08:00
parent 1c77c324f3
commit 15acb61b86
2 changed files with 10 additions and 9 deletions

View File

@@ -93,11 +93,12 @@ const doReward = async (user, fund) => {
vicFundSum: rewardInviter
}
}).then(() => {
createAction(2, {
createAction(4, {
userId: user.inviter,
tokenType: 'vic2vic', // 新模式标记
amount: rewardInviter,
remain: fund.asset
remain: fund.asset,
detail: { level: 1, info: '1级奖励' }
}).save();
}).catch(() => null);
}
@@ -136,10 +137,10 @@ async function mine (job = mock, done = mock) {
if (!userFundList || !Array.isArray(userFundList)) return 0;
for (let i = 0, len = userFundList.length; i < len; ++i) {
const fund = userFundList[i]; // 一条数据库fund表记录
if (fund.lastMine && new Date(fund.lastMine).getDate() === new Date().getDate()) {
mylog.info('已经计算过...跳过');
continue;
}
// if (fund.lastMine && new Date(fund.lastMine).getDate() === new Date().getDate()) {
// mylog.info('已经计算过...跳过');
// continue;
// }
const user = await User.findById(fund.userId).exec();
mylog.info('No. ', currentIndex, ' - ', i);
mylog.info('开始更新用户: ', user.id);