stanley-king 3 年之前
父節點
當前提交
008a25ed0d
共有 2 個文件被更改,包括 9 次插入6 次删除
  1. 8 5
      helper/refill/api/xyz/xiaoniu/RefillCallBack.php
  2. 1 1
      helper/refill/api/xyz/xiaoniu/RefillOil.php

+ 8 - 5
helper/refill/api/xyz/xiaoniu/RefillCallBack.php

@@ -53,12 +53,11 @@ class RefillCallBack implements refill\IRefillCallBack
         if (empty($order_info)) {
             return [false, false, false,false];
         }
-        Log::record("小牛油卡 官方凭证内容:{$params['content']}",Log::DEBUG);
-        $order_id = $order_info['order_id'];
-
-        $official_sn = $this->substr_content($params['content']);
 
+        $order_id = $order_info['order_id'];
         if ($status === 1) {
+            Log::record("小牛油卡 官方凭证内容:{$params['content']}",Log::DEBUG);
+            $official_sn = $this->substr_content($params['content']);
             $data['official_sn'] = strtolower($official_sn) == 'null' ? '' : $official_sn;
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false,true];
@@ -74,6 +73,10 @@ class RefillCallBack implements refill\IRefillCallBack
     private function substr_content($content)
     {
         $data = explode(':',$content);
-        return $data[1];
+        if(count($data) > 1) {
+            return $data[1];
+        } else {
+            return '';
+        }
     }
 }

+ 1 - 1
helper/refill/api/xyz/xiaoniu/RefillOil.php

@@ -7,7 +7,7 @@ require_once(BASE_HELPER_RAPI_PATH . '/xiaoniu/config.php');
 use refill;
 use Log;
 
-class RefillOil extends refill\IRefillPhone
+class RefillOil extends refill\IRefillOil
 {
     public function __construct($cfgs)
     {