From 30bc5c9ae773904c5651ccd6e45141e61c6df5fa Mon Sep 17 00:00:00 2001 From: lithromantic <223941@whut.edu.cn> Date: Tue, 14 Apr 2026 21:34:39 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B6=88=E8=80=97?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E4=BD=99=E9=A2=9D=E4=B9=9F=E4=BC=9A=E8=BF=94?= =?UTF-8?q?=E5=88=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复消耗账户余额也会返利的问题,修改后按照已抵扣后实际的付款金额返利,避免余额返利重复计算 --- app/Services/OrderService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 900be598e..cbf891a0c 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -74,12 +74,13 @@ public static function createFromRequest( $orderService->setVipDiscount($user); $orderService->setOrderType($user); - $orderService->setInvite(user: $user); if ($user->balance && $order->total_amount > 0) { $orderService->handleUserBalance($user, $userService); } + $orderService->setInvite(user: $user); + if (!$order->save()) { throw new ApiException(__('Failed to create order')); } From 3bc28c42e5fd12802ca7d1d114fd26d1d827cec7 Mon Sep 17 00:00:00 2001 From: lithromantic <223941@whut.edu.cn> Date: Tue, 28 Apr 2026 03:09:33 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=AD=E8=B4=B9=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=EF=BC=8C=E7=94=A8=E6=88=B7=E6=97=A0?= =?UTF-8?q?=E6=95=88=E6=88=96=E8=80=85=E5=BD=93=E5=89=8D=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E4=B8=8D=E7=AD=89=E4=BA=8E=E5=8D=B3=E5=B0=86=E7=BB=AD=E8=B4=B9?= =?UTF-8?q?=E7=9A=84=E5=A5=97=E9=A4=90=E7=9A=84=E6=97=B6=E5=80=99=E6=89=8D?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=E7=BB=AD=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 续费逻辑修改为,用户无效或者当前套餐不等于即将续费的套餐的时候才拒绝续费 --- app/Services/PlanService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/PlanService.php b/app/Services/PlanService.php index e67363d2c..0d729d451 100644 --- a/app/Services/PlanService.php +++ b/app/Services/PlanService.php @@ -158,7 +158,12 @@ protected function validatePlanAvailability(User $user): void } if (!$this->plan->show && $this->plan->renew && !app(UserService::class)->isAvailable($user)) { + // 只有当用户不是当前套餐时才拒绝 + if ($user->plan_id !== $this->plan->id) { throw new ApiException(__('This subscription has expired, please change to another subscription')); + } + // 如果是续费原套餐,允许操作 + return; } }