Browse Source

支付完成之后扔队列

tgz 2 years ago
parent
commit
dc409a96f6
1 changed files with 7 additions and 9 deletions
  1. 7 9
      app/Modules/Trade/Pay/OrderPaySuccess.php

+ 7 - 9
app/Modules/Trade/Pay/OrderPaySuccess.php

@@ -25,16 +25,14 @@ class OrderPaySuccess
         $is_change = self::orderAcrossDay($order);
         $order->transaction_id = $transaction_id;
         if ($order) {
-            try {
-                //添加异步任务队列
-                $job = new QappOrder($trade_no);
-                myLog('pay_notify')->info('start:' . $trade_no);
-                dispatch($job->onConnection('redis')->onQueue('{qapp_order_pay_success}'));
-                myLog('pay_notify')->info('end:' . $trade_no);
-            } catch (Exception $e) {
-                sendNotice($e->getMessage());
-            }
             if ($order->status == 'PAID') {
+                try {
+                    //添加异步任务队列
+                    $job = new QappOrder($trade_no);
+                    dispatch($job->onConnection('redis')->onQueue('{qapp_order_pay_success}'));
+                } catch (Exception $e) {
+                    sendNotice($e->getMessage());
+                }
                 myLog('pay_notify')->info('has_pay:' . $trade_no);
                 return true;
             }