Prechádzať zdrojové kódy

Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount

stanley-king 2 rokov pred
rodič
commit
c5965cc528

+ 3 - 0
helper/refill/api/xyz/douxun/RefillPhone.php

@@ -64,6 +64,9 @@ class RefillPhone extends refill\IRefillPhone
 
     public function query($refill_info)
     {
+        if (time() - $refill_info['commit_time'] > 86400*30) {
+            return [false, '时效已过'];
+        }
         $head['custInteId'] = config::custInteId;
         $head['echo'] = rand(100000,999999);
         $head['timestamp'] = date("YmdHis");

+ 1 - 1
helper/refill/api/xyz/douxun/config.php

@@ -10,7 +10,7 @@ class config
 
     const custInteId = 'BJQDWTC';
     const KEY = 'JK-BJQDWTC';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_douxun.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_douxun.php";
     const ExtHeaders = ['Content-Type:text/xml; charset=utf-8'];
 
     const operator = [

+ 9 - 2
helper/refill/api/yl/douxun/RefillPhone.php

@@ -64,6 +64,9 @@ class RefillPhone extends refill\IRefillPhone
 
     public function query($refill_info)
     {
+        if (time() - $refill_info['commit_time'] > 86400*30) {
+            return [false, '时效已过'];
+        }
         $head['custInteId'] = config::custInteId;
         $head['echo'] = rand(100000,999999);
         $head['timestamp'] = date("YmdHis");
@@ -90,9 +93,12 @@ class RefillPhone extends refill\IRefillPhone
             $resp = refill\util::xmlToArray($resp);
             if (empty($resp)) {
                 return [false, '网络错误'];
-            } elseif ($resp['head']['result'] === '0000') {
+            }
+            elseif ($resp['head']['result'] === '0000')
+            {
                 $item = $resp['body']['item'];
                 $status = $item['state'];
+
                 if ($status === '1') {
                     $order_state = ORDER_STATE_SUCCESS;
                     $updata['official_sn'] = $item['operatorNo'];
@@ -108,7 +114,8 @@ class RefillPhone extends refill\IRefillPhone
                 }
 
                 return [true, $order_state];
-            } else {
+            }
+            else {
                 return [false, $resp['head']['desc']];
             }
         }

+ 1 - 1
helper/refill/api/yl/douxun/config.php

@@ -10,7 +10,7 @@ class config
 
     const custInteId = 'YLYWTC';
     const KEY = 'JK-YLYWTC';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_douxun.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_douxun.php";
     const ExtHeaders = ['Content-Type:text/xml; charset=utf-8'];
 
     const operator = [