From bc7cdeed63f9ad095def6ca19cedc341944fda05 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 28 Jun 2024 18:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E6=AC=BE?= =?UTF-8?q?=E9=80=80=E6=AC=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 7b568c8a2..7d626adc1 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -425,6 +425,13 @@ class PayNotifyLogic extends BaseLogic $orderRe->refund_time = time(); $orderRe->remarks = ''; $orderRe->save(); + $purchase_funds = User::where('id',$orderRe['uid'])->value('purchase_funds'); + if($purchase_funds >= $orderRe['price']){ + User::where('id',$orderRe['uid'])->dec('purchase_funds',$orderRe['price'])->update(); + }else{ + User::where('id',$orderRe['uid'])->dec('purchase_funds',$purchase_funds)->update(); + } + self::descUserSing($orderRe); return true; }