diff --git a/src/modules/fund/fund.model.js b/src/modules/fund/fund.model.js index 9755b4a..8231fba 100644 --- a/src/modules/fund/fund.model.js +++ b/src/modules/fund/fund.model.js @@ -75,13 +75,17 @@ const FundSchema = new mongoose.Schema({ const FundModel = mongoose.model('Fund', FundSchema); -FundModel.prototype.hasNewDeposit = async function () { +FundModel.prototype.hasNewDeposit = async () => { if (this.tokenAddress.usdtETH) { const usdtTx = await getUSDTTxList(this.tokenAddress.usdtETH.address); - const fundList = this.fundList; - const newDepositList = getNewDepositTx(usdtTx, fundList); - if (newDepositList && newDepositList.length > 0) - return { hasNew: true, list: newDepositList }; + if (usdtTx && usdtTx.length > 0) { + const fundList = this.fundList; + const newDepositList = getNewDepositTx(usdtTx, fundList); + if (newDepositList && newDepositList.length > 0) { + mylog.info(`用户${this.userId} 有新的充值记录`); + return { hasNew: true, list: newDepositList }; + } + } } return { hasNew: false }; };