|
|
@@ -96,6 +96,13 @@ export class BalanceService {
|
|
|
userId: targetUserId
|
|
|
}
|
|
|
})
|
|
|
+ // 如果余额不存在
|
|
|
+ if (!targetBalance) {
|
|
|
+ targetBalance = new Balance()
|
|
|
+ targetBalance.userId = targetUserId
|
|
|
+ targetBalance.currentBalance = 0.00
|
|
|
+ targetBalance.totalBalance = 0.00
|
|
|
+ }
|
|
|
// 将余额划转目标用户
|
|
|
if (balance.currentBalance >= amount) {
|
|
|
const amountDecimal = new Decimal(amount)
|