fix : htf

This commit is contained in:
chaosBreaking
2019-09-29 13:26:03 +08:00
parent 0cb188bb8c
commit 1c127a0746

View File

@@ -75,14 +75,18 @@ const FundSchema = new mongoose.Schema({
const FundModel = mongoose.model('Fund', FundSchema); const FundModel = mongoose.model('Fund', FundSchema);
FundModel.prototype.hasNewDeposit = async function () { FundModel.prototype.hasNewDeposit = async () => {
if (this.tokenAddress.usdtETH) { if (this.tokenAddress.usdtETH) {
const usdtTx = await getUSDTTxList(this.tokenAddress.usdtETH.address); const usdtTx = await getUSDTTxList(this.tokenAddress.usdtETH.address);
if (usdtTx && usdtTx.length > 0) {
const fundList = this.fundList; const fundList = this.fundList;
const newDepositList = getNewDepositTx(usdtTx, fundList); const newDepositList = getNewDepositTx(usdtTx, fundList);
if (newDepositList && newDepositList.length > 0) if (newDepositList && newDepositList.length > 0) {
mylog.info(`用户${this.userId} 有新的充值记录`);
return { hasNew: true, list: newDepositList }; return { hasNew: true, list: newDepositList };
} }
}
}
return { hasNew: false }; return { hasNew: false };
}; };