From 76f3f429ae116afa014ca24904487f0f3eaa3cf6 Mon Sep 17 00:00:00 2001 From: "zhangf@suq.cn" Date: Thu, 18 Dec 2025 17:25:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(user):=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=99=E9=A2=9D=E6=89=A3=E9=99=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在API服务中添加了用户余额更新逻辑 - 扣除媒体分配价格后的余额写入数据库 - 确保交易一致性避免余额异常 --- app/service/user/ApiService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/service/user/ApiService.php b/app/service/user/ApiService.php index 2017068..2c58ccf 100644 --- a/app/service/user/ApiService.php +++ b/app/service/user/ApiService.php @@ -108,6 +108,9 @@ class ApiService extends BaseService if ($result['errorCode'] != '') { throw new ApiException($result['message']); } + $this->userDao->update($userInfo['id'], [ + 'balance' => $currentUser['balance'] - $media['price_assign'] + ]); return [ 'msg' => 'success' ];