瀏覽代碼

fix in coroutine mode callbak earlier than sumbmit success

stanley-king 3 年之前
父節點
當前提交
6075c75296
共有 1 個文件被更改,包括 12 次插入3 次删除
  1. 12 3
      helper/refill/RefillBase.php

+ 12 - 3
helper/refill/RefillBase.php

@@ -62,7 +62,7 @@ class RefillBase
             }
 
             if ($order_id !== false) {
-                return $this->proc_notify($order_id, $success, $can_try, $chname);
+                return $this->proc_notify($order_id, $success, $can_try, $chname,$input);
             } else {
                 Log::record("{$chname} callback 系统无此订单ID:{$order_id}", Log::ERR);
             }
@@ -75,7 +75,7 @@ class RefillBase
         return true;
     }
 
-    private function proc_notify($order_id,$success, $can_try,$chname)
+    private function proc_notify($order_id,$success, $can_try,$chname,$input=[])
     {
         $mod_order = Model('vr_order');
         $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
@@ -93,7 +93,16 @@ class RefillBase
 
             $order_info = $mod_order->getOrderInfo(['order_id' => $order_id],'*',true,true);
             $order_state = intval($order_info['order_state']);
-            if ($order_state != ORDER_STATE_SEND) {
+
+            if ($order_state == ORDER_STATE_PAY)
+            {
+                if(!empty($input)) {
+                    util::push_notify($chname,$input);
+                }
+                $tran->commit();
+                return false;
+            }
+            elseif ($order_state == ORDER_STATE_SUCCESS || $order_state == ORDER_STATE_CANCEL) {
                 $tran->commit();
                 return false;
             }