|
@@ -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 '';
|
|
|
+ }
|
|
|
}
|
|
|
}
|