stanley-king před 1 rokem
rodič
revize
3bba55a9cf

+ 1 - 1
helper/refill/api/xyz/weisanhuo/RefillCallBack.php

@@ -29,7 +29,7 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_id = $order_info['order_id'];
         if ($status == 'success') {
             $official_sn = $params['operatorTradeNo'];
-            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn, 'ch_trade_no' => $params['orderId']]);
+            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn, 'ch_trade_no' => $params['inTradeNo']]);
             return [$order_id, true, false, true, $official_sn];
         } elseif ($status == 'failed') {
             return [$order_id, false, true, true, ''];

+ 4 - 1
helper/refill/api/xyz/weisanhuo/RefillPhone.php

@@ -93,9 +93,12 @@ class RefillPhone extends refill\IRefillPhone
                     $status = $resp['data']['status'];
                     if ($status == 'success') {
                         $offical_sn = $resp['data']['operatorTradeNo'];
-                        Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $offical_sn]);
+                        $ch_trade_no = $resp['data']['inTradeNo'];
+                        Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $offical_sn,'ch_trade_no' => $ch_trade_no]);
                         $order_state = ORDER_STATE_SUCCESS;
                     } elseif ($status == 'failed') {
+                        $ch_trade_no = $resp['data']['inTradeNo'];
+                        Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $ch_trade_no]);
                         $order_state = ORDER_STATE_CANCEL;
                     } elseif ($status == 'waiting') {
                         $order_state = ORDER_STATE_SEND;