stanley-king 1 yıl önce
ebeveyn
işleme
3b4903aed5

+ 2 - 2
helper/refill/api/xyz/leyou/RefillOil.php

@@ -99,7 +99,7 @@ class RefillOil extends refill\IRefillOil
             {
                 $status = $resp['data']['status'];
                 if ($status === 5) {
-                    $official_sn = $extract_official_sn($resp['data']['voucher']);
+                    $official_sn = config::extract_official_sn($resp['data']['voucher']);
                     Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn]);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($status === 6) {
@@ -151,7 +151,7 @@ class RefillOil extends refill\IRefillOil
         $originalStr = '';
         foreach (config::SIGN_KEY_SORT as $key)
         {
-            if (isset($param[$key]) && !empty($param[$key])) {
+            if (!empty($param[$key])) {
                 $originalStr .= $param[$key];
             }
         }

+ 10 - 0
helper/refill/api/xyz/leyou/config.php

@@ -51,4 +51,14 @@ class config
         'money',
         'orderTime'
     ];
+
+    public static function extract_official_sn($voucher): string
+    {
+        $matches = [];
+        if (preg_match("/\:(\d+)/", $voucher, $matches)) {
+            return $matches[1];
+        } else {
+            return '';
+        }
+    }
 }