stanley-king 3 anni fa
parent
commit
ef889a5cf9

+ 2 - 13
helper/refill/api/xyz/menggu/RefillCallBack.php

@@ -57,9 +57,8 @@ class RefillCallBack implements refill\IRefillCallBack
         if ($status === 2) {
             Log::record("mengu sms:{$params['ext1']}",Log::DEBUG);
             Model('')->table('refill_ext')->insert(['order_id' => $order_id, 'sms' => $params['ext1']]);
-            $official_sn = $this->official_sn($params['ext1']);
-            $data['official_sn'] = strtolower($official_sn) == 'null' ? '' : $official_sn;
-            Model('refill_order')->edit($order_id, $data);
+            $official_sn = config::official_sn($params['ext1']);
+            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn]);
             return [$order_id, true, false,true];
         }
         elseif ($status === 3) {
@@ -69,14 +68,4 @@ class RefillCallBack implements refill\IRefillCallBack
             return [$order_id, false, false,false];
         }
     }
-
-    private function official_sn($content)
-    {
-        $data = explode(':',$content);
-        if(count($data) > 1) {
-            return $data[1];
-        } else {
-            return '';
-        }
-    }
 }

+ 3 - 16
helper/refill/api/xyz/menggu/RefillOil.php

@@ -85,9 +85,9 @@ class RefillOil extends refill\IRefillOil
                 if ($status === 2) {
                     Log::record("mengu query sms:{$resp['ext1']}",Log::DEBUG);
                     Model('')->table('refill_ext')->insert(['order_id' => $refill_info['order_id'], 'sms' => $resp['ext1']]);
-                    $official_sn = $this->substr_content($resp['ext1']);
-                    $updata['official_sn'] = $official_sn;
-                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $official_sn = config::official_sn($resp['ext1']);
+
+                    Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn]);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($status === 3) {
                     $order_state = ORDER_STATE_CANCEL;
@@ -131,9 +131,6 @@ class RefillOil extends refill\IRefillOil
         }
     }
 
-    /**
-     * 获取毫秒级别的时间戳
-     */
     private function get_millisecond()
     {
         list($usec, $sec) = explode(" ", microtime());
@@ -153,14 +150,4 @@ class RefillOil extends refill\IRefillOil
         $content = rtrim($content, '&');
         return md5($content);
     }
-
-    private function substr_content($content)
-    {
-        $data = explode(':',$content);
-        if(count($data) > 1) {
-            return $data[1];
-        } else {
-            return '';
-        }
-    }
 }

+ 11 - 0
helper/refill/api/xyz/menggu/config.php

@@ -20,4 +20,15 @@ class config
         ]
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+
+    public static function official_sn($content)
+    {
+        $data = explode(':',$content);
+        if(count($data) > 1) {
+            return $data[1];
+        } else {
+            return '';
+        }
+    }
 }

+ 1 - 1
mobile/callback/qianqian.php

@@ -2,7 +2,7 @@
 
 $content = $_SERVER['post_content'];
 
-$inputs = json_decode($content,true);
+$inputs = json_decode($content,true) ?? [];
 foreach ($inputs as $input) {
     refill\util::push_notify('qianqian',$input);
 }

+ 1 - 1
mobile/callback/qianqianman.php

@@ -2,7 +2,7 @@
 
 $content = $_SERVER['post_content'];
 
-$inputs = json_decode($content,true);
+$inputs = json_decode($content,true) ?? [];
 foreach ($inputs as $input) {
     refill\util::push_notify('qianqianman',$input);
 }

+ 1 - 1
mobile/callback/refill_jinfeng.php

@@ -2,7 +2,7 @@
 
 $content = $_SERVER['post_content'];
 
-$inputs = json_decode($content,true);
+$inputs = json_decode($content,true) ?? [];
 foreach ($inputs as $input) {
     refill\util::push_notify('jinfeng',$input);
 }

+ 1 - 1
mobile/callback/refill_lingzhman.php

@@ -2,7 +2,7 @@
 
 $content = $_SERVER['post_content'];
 
-$inputs = json_decode($content,true);
+$inputs = json_decode($content,true) ?? [];
 foreach ($inputs as $input) {
     refill\util::push_notify('lingzhman',$input);
 }

+ 1 - 1
mobile/callback/refill_lingzhman48.php

@@ -2,7 +2,7 @@
 
 $content = $_SERVER['post_content'];
 
-$inputs = json_decode($content,true);
+$inputs = json_decode($content,true) ?? [];
 foreach ($inputs as $input) {
     refill\util::push_notify('lingzhman48',$input);
 }

+ 1 - 1
mobile/callback/refill_wenye.php

@@ -2,7 +2,7 @@
 
 $content = $_SERVER['post_content'];
 
-$inputs = json_decode($content,true);
+$inputs = json_decode($content,true) ?? [];
 foreach ($inputs as $input) {
     refill\util::push_notify('wenye',$input);
 }