From 8939377ecf381f14fafb03530bbc62459168fb58 Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Mon, 7 Oct 2019 17:43:59 +0800 Subject: [PATCH] timestamp --- src/common/deposit.js | 1 + src/modules/fund/fund.controller.js | 1 - src/modules/fund/fund.handler.js | 2 +- src/modules/fund/fund.model.js | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/deposit.js b/src/common/deposit.js index 0b92685..7986f22 100644 --- a/src/common/deposit.js +++ b/src/common/deposit.js @@ -7,6 +7,7 @@ const getUSDTTxList = async address => { const res = await ERC20.getActions(address, USDTAddr, startBlock).catch(err => { if (err) return []; }); + mylog.info(res, res.filter(tx => tx.to === address)); return res.filter(tx => tx.to === address); //只取转入到本地址的 }; diff --git a/src/modules/fund/fund.controller.js b/src/modules/fund/fund.controller.js index 1114cfd..9234cfa 100644 --- a/src/modules/fund/fund.controller.js +++ b/src/modules/fund/fund.controller.js @@ -265,7 +265,6 @@ module.exports = { } }); } - mylog.info(list); let [newFund, actions] = await Promise.all([ fund.addFund(list, { inviter }), Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } }) diff --git a/src/modules/fund/fund.handler.js b/src/modules/fund/fund.handler.js index a834e57..ec593f7 100644 --- a/src/modules/fund/fund.handler.js +++ b/src/modules/fund/fund.handler.js @@ -8,7 +8,7 @@ const DayLong = 24 * 60 * 60 * 1000; */ class Fund { constructor (data = {}) { - const { amount, blockNumber, hash = '', blockHash = '', from = '', to = '', timeStamp, usdtValue = 0, type = 'deposit' } = data; + const { amount, blockNumber, hash = '', blockHash = '', from = '', to = '', timeStamp = '', usdtValue = 0, type = 'deposit' } = data; this.status = 0; this.type = type; this.amount = +amount; diff --git a/src/modules/fund/fund.model.js b/src/modules/fund/fund.model.js index 6bf2be2..0431491 100644 --- a/src/modules/fund/fund.model.js +++ b/src/modules/fund/fund.model.js @@ -108,7 +108,6 @@ FundModel.prototype.addFund = async function (txlist = [], option) { }); typeof action.save === 'function' && actionPromiseList.push(action.save()); txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率 !!!! - mylog.info(JSON.stringify(txObj)); return createNewFund({...txObj}); }); // 1.注入资金