|
@@ -182,6 +182,14 @@ export class BalanceService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ async screenRecharge(userId: number, amount: number) {
|
|
|
|
|
+ const users = await this.usersService.findById(userId)
|
|
|
|
|
+ const screenBalance = new Decimal(users.screenBalance)
|
|
|
|
|
+ users.screenBalance = screenBalance.plus(amount).toNumber()
|
|
|
|
|
+
|
|
|
|
|
+ return await this.userRepository.save(users)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
async changeScreenBalance(userId: number, amount: number) {
|
|
async changeScreenBalance(userId: number, amount: number) {
|
|
|
const amountDecimal = new Decimal(amount)
|
|
const amountDecimal = new Decimal(amount)
|
|
|
const users = await this.usersService.findById(userId)
|
|
const users = await this.usersService.findById(userId)
|
|
@@ -239,7 +247,7 @@ export class BalanceService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async feeRefund(userId: number, amount: number, taskId: number){
|
|
|
|
|
|
|
+ async feeRefund(userId: number, amount: number, taskId: number) {
|
|
|
try {
|
|
try {
|
|
|
const user = await this.usersService.findById(userId)
|
|
const user = await this.usersService.findById(userId)
|
|
|
// 获取余额
|
|
// 获取余额
|