moonsflyer пре 4 месеци
родитељ
комит
70fc52b32e
1 измењених фајлова са 20 додато и 19 уклоњено
  1. 20 19
      app/common/service/pay/MixedPayService.php

+ 20 - 19
app/common/service/pay/MixedPayService.php

@@ -122,25 +122,26 @@ class MixedPayService extends BasePayService
 
             // 先扣除用户余额
             if ($balanceAmount > 0) {
-                User::update([
-                    'user_money' => ['dec', $balanceAmount]
-                ], ['id' => $order['user_id']]);
-
-                // 记录余额流水
-                AccountLogLogic::add(
-                    $order['user_id'],
-                    AccountLogEnum::BNW_DEC_ORDER,
-                    AccountLogEnum::DEC,
-                    $balanceAmount,
-                    $order['sn'],
-                    '混合支付-余额部分'
-                );
-
-                file_put_contents(
-                    runtime_path() . 'log' . DIRECTORY_SEPARATOR . 'mixed_pay_debug_' . date('Y-m-d') . '.log',
-                    "[" . date('Y-m-d H:i:s') . "] 余额扣除成功,扣除金额: {$balanceAmount}" . PHP_EOL,
-                    FILE_APPEND | LOCK_EX
-                );
+                //先不扣余额,等为微信支付成功后扣钱
+//                User::update([
+//                    'user_money' => ['dec', $balanceAmount]
+//                ], ['id' => $order['user_id']]);
+//
+//                // 记录余额流水
+//                AccountLogLogic::add(
+//                    $order['user_id'],
+//                    AccountLogEnum::BNW_DEC_ORDER,
+//                    AccountLogEnum::DEC,
+//                    $balanceAmount,
+//                    $order['sn'],
+//                    '混合支付-余额部分'
+//                );
+//
+//                file_put_contents(
+//                    runtime_path() . 'log' . DIRECTORY_SEPARATOR . 'mixed_pay_debug_' . date('Y-m-d') . '.log',
+//                    "[" . date('Y-m-d H:i:s') . "] 余额扣除成功,扣除金额: {$balanceAmount}" . PHP_EOL,
+//                    FILE_APPEND | LOCK_EX
+//                );
 
                 Order::update([
                     'balance_amount' =>  $balanceAmount