Explorar el Código

云选联盟订单支付40分钟后回传 调试

shensong00 hace 3 meses
padre
commit
2654c95805

+ 3 - 4
app/Console/Commands/Order/SyncYunXuanOrder.php

@@ -50,7 +50,6 @@ class SyncYunXuanOrder extends Command
50 50
                         'start_time' => intval($startTime.'000'),
51 51
                         'end_time' => intval($endTime.'000'),
52 52
                         'share_id' => $config['share_id'],
53
-//                        'tx_cps_id' => "",
54 53
                     ]
55 54
                 ], 256);
56 55
                 $response = YXRequestService::sendRequestWithAppAuth($appKey, $appSecret, $method, $requestUrl, $contentType, $acceptHeader, $reqBody);
@@ -85,9 +84,9 @@ class SyncYunXuanOrder extends Command
85 84
                 'trace' => $e->getTraceAsString()
86 85
             ], 'YunXuanOrderList-Exception');
87 86
 
88
-//            EmailQueue::rPush('云选联盟平台订单获取过程发生异常', json_encode([
89
-//                'message' => $e->getMessage()
90
-//            ], 256), ['song.shen@kuxuan-inc.com'], '猎羽');
87
+            EmailQueue::rPush('云选联盟平台订单获取过程发生异常', json_encode([
88
+                'message' => $e->getMessage()
89
+            ], 256), ['song.shen@kuxuan-inc.com'], '猎羽');
91 90
         }
92 91
 
93 92
         return true;

+ 11 - 0
app/Models/Tencent/YxOrder.php

@@ -2,6 +2,7 @@
2 2
 
3 3
 namespace App\Models\Tencent;
4 4
 
5
+use App\Log;
5 6
 use App\Models\TencentAdAuth;
6 7
 use Illuminate\Database\Eloquent\Model;
7 8
 
@@ -103,6 +104,16 @@ class YxOrder extends Model
103 104
             TencentAdAuth::intoActionAddListSecond($res->toArray());
104 105
         }
105 106
 
107
+        if (
108
+//            $res->payment_amount > 0 &&
109
+            $res->order_status == 1 &&
110
+            (isset($res->ad_report_order_status) && $res->ad_report_order_status != 0)// 已经进行过回传处理的订单此项数据会发生变化
111
+            && ($res->payed_time <= date('Y-m-d H:i:s', strtotime('-40 minutes')))) {# 支付成功40分钟后再进行回传,尽量避免一些由于用户取消支付导致回传数据
112
+            # 数据回传
113
+//            TencentAdAuth::intoActionAddListSecond($res->toArray());
114
+            Log::logInfo('订单回传入队列记录', [$res], 'YXorder');
115
+        }
116
+
106 117
         return $res->id ?? 0;
107 118
     }
108 119
 }