|
@@ -65,7 +65,7 @@ export class RepayService extends BaseService {
|
|
return {
|
|
return {
|
|
currency: item.currency,
|
|
currency: item.currency,
|
|
balance: item.balance,
|
|
balance: item.balance,
|
|
- withdrawBalance: (+item.balance - +item.freeze).toFixed(2),
|
|
|
|
|
|
+ withdrawBalance: (+item.balance - Math.abs(+item.freeze)).toFixed(2),
|
|
freeze: item.freeze,
|
|
freeze: item.freeze,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -299,7 +299,7 @@ export class RepayService extends BaseService {
|
|
async validBalance(merchant, currency, amount) {
|
|
async validBalance(merchant, currency, amount) {
|
|
const wallet = await this.walletService.queryByMchIdAndCurrency(merchant.mchId, currency);
|
|
const wallet = await this.walletService.queryByMchIdAndCurrency(merchant.mchId, currency);
|
|
const { balance = 0, freeze = 0 } = wallet;
|
|
const { balance = 0, freeze = 0 } = wallet;
|
|
- if (+amount > +balance - +freeze) {
|
|
|
|
|
|
+ if (+amount > +balance - Math.abs(+freeze)) {
|
|
throw new Error('当前商户余额不足,请确认!当前商户可提现余额:' + (+balance - +freeze));
|
|
throw new Error('当前商户余额不足,请确认!当前商户可提现余额:' + (+balance - +freeze));
|
|
}
|
|
}
|
|
}
|
|
}
|