Browse Source

付款码轮询

gorden 6 months ago
parent
commit
b74e4d7ff5
2 changed files with 248 additions and 246 deletions
  1. 243 243
      app/admin/controller/order/WholeController.php
  2. 5 3
      app/admin/service/order/OrderService.php

File diff suppressed because it is too large
+ 243 - 243
app/admin/controller/order/WholeController.php


+ 5 - 3
app/admin/service/order/OrderService.php

@@ -254,9 +254,10 @@ class OrderService
             throw new BusinessException("订单查询失败");
         }
         try{
-            $result = Pay::wechat(config('payment.wxpay'))->find($orderId,'pos');
-            $result = json_decode(json_encode($result),true);
-
+            if ($nbr > 3){
+                $result = Pay::wechat(config('payment.wxpay'))->find($orderId,'pos');
+                $result = json_decode(json_encode($result),true);
+            }
         }catch (\Exception $e){
             throw new BusinessException("订单查询失败");
         }
@@ -264,6 +265,7 @@ class OrderService
         if (!empty($result['return_code']) && $result['return_code'] == 'SUCCESS' && !empty($result['result_code']) && $result['result_code'] == 'SUCCESS'){
             return $result;
         }else{
+            dump("睡:".$nbr);
             sleep(6);
             self::findWxpay($orderId,$nbr + 1);
         }

Some files were not shown because too many files changed in this diff