feat(channel): 新增电话充值不同类型方法
- 在 Xinwang 类中添加了多个新的充值类型方法,包括 ydcz、ydcz_cjkc、ltcz、ltcz_cjkc、dxcz 和 dxcz_cjkc- 这些新方法通过设置不同的 isp_type 属性来区分不同的充值类型 - 修改了 dhcz 方法,支持根据 isp_type 进行充值类型判断 - 优化了 notify 方法中的状态处理逻辑- 在 order 控制器中修复了 other_param 相关的逻辑错误 - 在 merchant 视图中添加了复冲次数输入框
This commit is contained in:
parent
be368f3748
commit
2c7d8ec064
@ -14,6 +14,7 @@ class Xinwang extends Core
|
|||||||
protected $mid = '';
|
protected $mid = '';
|
||||||
protected $token = '';
|
protected $token = '';
|
||||||
protected $api = 'api/phoneOrder';
|
protected $api = 'api/phoneOrder';
|
||||||
|
protected $isp_type = false;
|
||||||
|
|
||||||
# 电话充值
|
# 电话充值
|
||||||
public function dhcz($param)
|
public function dhcz($param)
|
||||||
@ -25,6 +26,9 @@ class Xinwang extends Core
|
|||||||
'teltype' => 'teltype',
|
'teltype' => 'teltype',
|
||||||
);
|
);
|
||||||
$param['teltype'] = 1;
|
$param['teltype'] = 1;
|
||||||
|
if($this->isp_type){
|
||||||
|
$param['teltype'] = $this->isp_type;
|
||||||
|
}else{
|
||||||
if (isset($param['isp']) && $param['isp']) {
|
if (isset($param['isp']) && $param['isp']) {
|
||||||
if($param['isp'] == 1){
|
if($param['isp'] == 1){
|
||||||
$param['teltype'] = 2;
|
$param['teltype'] = 2;
|
||||||
@ -35,20 +39,53 @@ class Xinwang extends Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->api = 'api/v2/order/audit/add';
|
$this->api = 'api/v2/order/audit/add';
|
||||||
|
|
||||||
|
|
||||||
return $this->submit($param, $check);
|
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是失败
|
# 通知处理 主要返回状态 2是成功 3是失败
|
||||||
public function notify($data)
|
public function notify($data)
|
||||||
{
|
{
|
||||||
$request = $data;
|
$request = $data;
|
||||||
$result = array();
|
$result = array();
|
||||||
$result['cash'] = 1;
|
$result['cash'] = 1;
|
||||||
$result['status'] = 4;
|
|
||||||
if ($data['status'] == 1) {
|
if ($data['status'] == 1) {
|
||||||
$result['status'] = 2;
|
$result['status'] = 2;
|
||||||
} elseif ($data['status'] == 2 || $data['status'] == 3) {
|
} elseif ($data['status'] == 2 || $data['status'] == 3) {
|
||||||
@ -59,7 +96,7 @@ class Xinwang extends Core
|
|||||||
|
|
||||||
if (isset($data['pay_orderid']) && $data['pay_orderid']) {
|
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';
|
$result['yes'] = 'success';
|
||||||
@ -114,7 +151,7 @@ class Xinwang extends Core
|
|||||||
$request['mchid'] = $this->mid;
|
$request['mchid'] = $this->mid;
|
||||||
$request['orderid'] = $param['order'];
|
$request['orderid'] = $param['order'];
|
||||||
$request['notify'] = $this->getNotify($param['order'], 1);
|
$request['notify'] = $this->getNotify($param['order'], 1);
|
||||||
$request['timeout'] = 86400;
|
$request['timeout'] = $this->getGid($param['cash']);
|
||||||
$request['rand'] = rand(100000, 999999);
|
$request['rand'] = rand(100000, 999999);
|
||||||
$request['sign'] = $this->_sign($request);
|
$request['sign'] = $this->_sign($request);
|
||||||
$url = $this->host . $this->api;
|
$url = $this->host . $this->api;
|
||||||
@ -123,6 +160,9 @@ class Xinwang extends Core
|
|||||||
//$response['data'] = '';
|
//$response['data'] = '';
|
||||||
//$response['msg'] = 'ok';
|
//$response['msg'] = 'ok';
|
||||||
$channel_order_id = '';
|
$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']);
|
$this->create($param['order'], $channel_order_id, $param['merchant_order'], $param['cash'], $url, $request, $response, 1, $param['account']);
|
||||||
return $response['msg'];
|
return $response['msg'];
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
<span class="color-desc">优选级(数字越大优先级越高):</span>
|
<span class="color-desc">优选级(数字越大优先级越高):</span>
|
||||||
<input class="layui-input" type="number" placeholder="请输入数字,数字越大优先级越高" name="sort_{$v.id}" value="{$v.sort|default=''}"/>
|
<input class="layui-input" type="number" placeholder="请输入数字,数字越大优先级越高" name="sort_{$v.id}" value="{$v.sort|default=''}"/>
|
||||||
</td>
|
</td>
|
||||||
|
<td class='text-left nowrap'>
|
||||||
|
<span class="color-desc">复冲次数(根据渠道的复充次数):</span>
|
||||||
|
<input class="layui-input" type="number" placeholder="请输入根据渠道的复充次数" name="fc_numer_{$v.id}" value="{$v.fc_numer|default=''}"/>
|
||||||
|
</td>
|
||||||
<td class='text-left nowrap'>
|
<td class='text-left nowrap'>
|
||||||
{if $v.value}
|
{if $v.value}
|
||||||
<span class="color-desc">可选面值(未选择面值则所有面值可用):</span>
|
<span class="color-desc">可选面值(未选择面值则所有面值可用):</span>
|
||||||
|
@ -231,6 +231,8 @@ class Test extends Core
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function test_suoding()
|
public function test_suoding()
|
||||||
{
|
{
|
||||||
$data = Db::name('channel_kami')->where(['status'=>0,'use_mid'=>-1])->select()->toArray();
|
$data = Db::name('channel_kami')->where(['status'=>0,'use_mid'=>-1])->select()->toArray();
|
||||||
|
@ -892,12 +892,12 @@ class Order extends Controller
|
|||||||
$request = [];
|
$request = [];
|
||||||
$request['agentId'] = $merchant['agentId'];
|
$request['agentId'] = $merchant['agentId'];
|
||||||
$request['agentkey'] = $merchant['agentkey'];
|
$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['agentId'] = $other_param['reapi_appkey'];
|
||||||
$request['agentkey'] = $other_param['reapi_appsecret'];
|
$request['agentkey'] = $other_param['reapi_appsecret'];
|
||||||
$Seesionkey = $this->merchant['access_token'];
|
$Seesionkey = $merchant['access_token'];
|
||||||
|
|
||||||
}
|
}
|
||||||
$request['tid'] = $merchant_order_id;
|
$request['tid'] = $merchant_order_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user