fix: 只找vicFundSum大于0的&分配比例
This commit is contained in:
4
clean.js
4
clean.js
@@ -48,8 +48,8 @@ async function clean () {
|
||||
const releasedAmout = (await Action.find({ type: '1', userId: userFund.userId })).reduce((sum, action) => sum + +action.amount, 0);
|
||||
const rest = boughtAmountSum - releasedAmout;
|
||||
mylog.info('No. ', currentIndex, '用户' + userFund.userId, '剩余 ', rest);
|
||||
await Fund.findByIdAndUpdate(userFund.id, { fundList: [], 'option.restNeetToRelease': rest });
|
||||
// await Fund.findByIdAndUpdate(userFund.id, { fundList: [], $inc: {'asset.vic': userFund.option.restNeetToRelease } });
|
||||
const vic = userFund.asset.vic || 0;
|
||||
await Fund.findByIdAndUpdate(userFund.id, { vicFundSum: vic, 'asset.vic': 0, fundList: [], 'option.restNeetToRelease': rest, snapshot: { asset: userFund.asset } });
|
||||
probe.currentIndex = currentIndex;
|
||||
}
|
||||
process.exit();
|
||||
|
||||
Reference in New Issue
Block a user