timestamp

This commit is contained in:
chaosBreaking
2019-10-07 17:43:59 +08:00
parent a5195c8f2b
commit 8939377ecf
4 changed files with 2 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ const getUSDTTxList = async address => {
const res = await ERC20.getActions(address, USDTAddr, startBlock).catch(err => { const res = await ERC20.getActions(address, USDTAddr, startBlock).catch(err => {
if (err) return []; if (err) return [];
}); });
mylog.info(res, res.filter(tx => tx.to === address));
return res.filter(tx => tx.to === address); //只取转入到本地址的 return res.filter(tx => tx.to === address); //只取转入到本地址的
}; };

View File

@@ -265,7 +265,6 @@ module.exports = {
} }
}); });
} }
mylog.info(list);
let [newFund, actions] = await Promise.all([ let [newFund, actions] = await Promise.all([
fund.addFund(list, { inviter }), fund.addFund(list, { inviter }),
Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } }) Action.find({ userId, type: 1, createdAt: { $gt: start, $lt: now } })

View File

@@ -8,7 +8,7 @@ const DayLong = 24 * 60 * 60 * 1000;
*/ */
class Fund { class Fund {
constructor (data = {}) { 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.status = 0;
this.type = type; this.type = type;
this.amount = +amount; this.amount = +amount;

View File

@@ -108,7 +108,6 @@ FundModel.prototype.addFund = async function (txlist = [], option) {
}); });
typeof action.save === 'function' && actionPromiseList.push(action.save()); typeof action.save === 'function' && actionPromiseList.push(action.save());
txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率 txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率
mylog.info(JSON.stringify(txObj));
return createNewFund({...txObj}); return createNewFund({...txObj});
}); });
// 1.注入资金 // 1.注入资金