From cbd3f2b34b536074d4fdf2d6f818b6c5b15469cd Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Mon, 24 Jun 2024 11:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=99=E9=A2=9D,=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=AC=BE=E9=80=80=E6=AC=BE=E7=9B=B8=E5=85=B3=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 5f84a2d92..a9d6de6d4 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -266,21 +266,27 @@ class PayNotifyLogic extends BaseLogic $order->refund_reason_time = time(); $order->refund_num += 1; $order->save(); + //日志记录 //加用户余额,采购款, 日志记录 加数量 if (in_array($order['pay_type'],[PayEnum::BALANCE_PAY,PayEnum::PURCHASE_FUNDS])){ $deal_money = bcdiv($extra['amount']['refund'], 100, 2); $user = User::where('id', $order['uid'])->findOrEmpty(); - if($order['pay_type'] == PayEnum::BALANCE_PAY){ + $capitalFlowDao = new CapitalFlowLogic($user); + if($order['pay_type'] == PayEnum::BALANCE_PAY){//用户余额 $user->now_money = bcadd($user->now_money, $deal_money, 2); $user->save(); //增加数量 self::addStock($order['id']); + //退款 + $capitalFlowDao->userIncome('system_balance_back', 'system_back', $order['id'], $deal_money); } - if($order['pay_type'] == PayEnum::PURCHASE_FUNDS){ + if($order['pay_type'] == PayEnum::PURCHASE_FUNDS){//采购款 $user->purchase_funds = bcadd($user->purchase_funds, $deal_money, 2); $user->save(); //增加数量 self::addStock($order['id']); + //退款 + $capitalFlowDao->userIncome('system_purchase_back', 'system_back', $order['id'], $deal_money); } }