diff --git a/app/channel/service/system/Xinwang.php b/app/channel/service/system/Xinwang.php index 4605566..93e9d9f 100644 --- a/app/channel/service/system/Xinwang.php +++ b/app/channel/service/system/Xinwang.php @@ -14,6 +14,7 @@ class Xinwang extends Core protected $mid = ''; protected $token = ''; protected $api = 'api/phoneOrder'; + protected $isp_type = false; # 电话充值 public function dhcz($param) @@ -25,30 +26,66 @@ class Xinwang extends Core 'teltype' => 'teltype', ); $param['teltype'] = 1; - if (isset($param['isp']) && $param['isp']) { - if($param['isp'] == 1){ - $param['teltype'] = 2; - }else if($param['isp'] == 2){ - $param['teltype'] = 3; - }else{ - $param['teltype'] = 1; - } + if($this->isp_type){ + $param['teltype'] = $this->isp_type; + }else{ + if (isset($param['isp']) && $param['isp']) { + if($param['isp'] == 1){ + $param['teltype'] = 2; + }else if($param['isp'] == 2){ + $param['teltype'] = 3; + }else{ + $param['teltype'] = 1; + } + } } $this->api = 'api/v2/order/audit/add'; - return $this->submit($param, $check); } + public function ydcz($param) + { + $this->isp_type = 2; + return $this->dhcz($param); + } + public function ydcz_cjkc($param) + { + $this->isp_type = 2; + return $this->dhcz($param); + } + public function ltcz($param) + { + $this->isp_type = 3; + return $this->dhcz($param); + } + public function ltcz_cjkc($param) + { + $this->isp_type = 3; + return $this->dhcz($param); + } + public function dxcz($param) + { + $this->isp_type = 1; + return $this->dhcz($param); + } + + public function dxcz_cjkc($param) + { + $this->isp_type = 1; + return $this->dhcz($param); + } + + + # 通知处理 主要返回状态 2是成功 3是失败 public function notify($data) { $request = $data; $result = array(); $result['cash'] = 1; - $result['status'] = 4; if ($data['status'] == 1) { $result['status'] = 2; } elseif ($data['status'] == 2 || $data['status'] == 3) { @@ -59,7 +96,7 @@ class Xinwang extends Core if (isset($data['pay_orderid']) && $data['pay_orderid']) { # 流水号 - $data['s_nubmer'] = $result['s_nubmer'] = $data['pay_orderid']; + $data['s_number'] = $result['s_number'] = $data['pay_orderid']; } $result['yes'] = 'success'; @@ -114,7 +151,7 @@ class Xinwang extends Core $request['mchid'] = $this->mid; $request['orderid'] = $param['order']; $request['notify'] = $this->getNotify($param['order'], 1); - $request['timeout'] = 86400; + $request['timeout'] = $this->getGid($param['cash']); $request['rand'] = rand(100000, 999999); $request['sign'] = $this->_sign($request); $url = $this->host . $this->api; @@ -123,6 +160,9 @@ class Xinwang extends Core //$response['data'] = ''; //$response['msg'] = 'ok'; $channel_order_id = ''; + if(isset($response['array']['orderid']) && $response['array']['orderid']){ + $channel_order_id = $response['array']['orderid']; + } $this->create($param['order'], $channel_order_id, $param['merchant_order'], $param['cash'], $url, $request, $response, 1, $param['account']); return $response['msg']; diff --git a/app/merchant/view/product/setting.html b/app/merchant/view/product/setting.html index 7c1f9d2..b18dce2 100644 --- a/app/merchant/view/product/setting.html +++ b/app/merchant/view/product/setting.html @@ -40,6 +40,10 @@ 优选级(数字越大优先级越高): +