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 @@ 优选级(数字越大优先级越高): + + 复冲次数(根据渠道的复充次数): + + {if $v.value} 可选面值(未选择面值则所有面值可用): diff --git a/app/openapi/controller/Test.php b/app/openapi/controller/Test.php index 3ec78fa..0430b6e 100644 --- a/app/openapi/controller/Test.php +++ b/app/openapi/controller/Test.php @@ -230,6 +230,8 @@ class Test extends Core } + + public function test_suoding() { diff --git a/app/order/controller/Order.php b/app/order/controller/Order.php index f870bf7..81b5974 100644 --- a/app/order/controller/Order.php +++ b/app/order/controller/Order.php @@ -892,12 +892,12 @@ class Order extends Controller $request = []; $request['agentId'] = $merchant['agentId']; $request['agentkey'] = $merchant['agentkey']; - if(isset($merchant['other_param']) && $merchant['other_param'] && str_contains($this->merchant['other_param'], "reapi_appkey")) + if(isset($merchant['other_param']) && $merchant['other_param'] && str_contains($merchant['other_param'], "reapi_appkey")) { - $other_param = json_decode($this->merchant['other_param'], true); + $other_param = json_decode($merchant['other_param'], true); $request['agentId'] = $other_param['reapi_appkey']; $request['agentkey'] = $other_param['reapi_appsecret']; - $Seesionkey = $this->merchant['access_token']; + $Seesionkey = $merchant['access_token']; } $request['tid'] = $merchant_order_id;