297 行
8.1 KiB
PHP
可执行文件
297 行
8.1 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Admin\Controller;
|
|
|
|
use Think\Controller;
|
|
use Think\Page;
|
|
|
|
//[1.3.46]
|
|
class PaysetController extends BaseController
|
|
{
|
|
/**
|
|
* 支付页面
|
|
*/
|
|
public function paySet()
|
|
{
|
|
$merchant_id = I('get.merchant_id');
|
|
if (empty($merchant_id)) {
|
|
$this->error("请求有误");
|
|
exit;
|
|
}
|
|
// 查询商户设置
|
|
$result = A('Api/RetailPaySet')->getPaySet($merchant_id);
|
|
$this->assign('merchant_id', $merchant_id);
|
|
$this->assign('entry_status', $result['entry_status']);
|
|
$this->assign("merchantInfo", json_encode($result['merchantInfo']));
|
|
$this->assign('entry', json_encode($result['entry']));
|
|
$this->assign('pay', json_encode($result['paySet']));
|
|
$this->assign('open_user', 3);
|
|
// 节点
|
|
$arr = array(
|
|
'doSetPaySet' => '/index.php/Admin/Payset/doSetPaySet',
|
|
);
|
|
$authArr = checkFunction($arr);
|
|
$this->assign('authArr', $authArr);
|
|
$this->display();
|
|
}
|
|
|
|
/* 获取该代理商支付模式权限
|
|
* @return array
|
|
* */
|
|
public function get_pay_pattern()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
$pay_list = M('retail_merchant as m')
|
|
->join('ls_retail_pay_pattern as p on p.agent_id=m.agentid')
|
|
->field('p.general_pay,p.service_pay,p.new_continent_pay')
|
|
->where(array('m.id' => $merchant_id))
|
|
->find();
|
|
$res['general_pay'] = $pay_list['general_pay'] ? $pay_list['general_pay'] : 0;
|
|
$res['service_pay'] = $pay_list['service_pay'] ? $pay_list['service_pay'] : 0;
|
|
$res['new_continent_pay'] = $pay_list['new_continent_pay'] ? $pay_list['new_continent_pay'] : 0;
|
|
$res['close_pay_type'] = 1;
|
|
$res['status'] = 1;
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
|
|
/**
|
|
* 上传证书
|
|
*/
|
|
public function upload()
|
|
{
|
|
$res = A('Api/RetailPaySet')->upload();
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 图片上传
|
|
*/
|
|
public function uploads()
|
|
{
|
|
// 判断登录
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res['status'] = 0;
|
|
$res['msg'] = '请求有误';
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->uploads($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 保存支付设置
|
|
*/
|
|
public function doSetPaySet()
|
|
{
|
|
if (IS_POST) {
|
|
$merchant_id = I('post.merchant_id');
|
|
if (empty($merchant_id)) {
|
|
$res['status'] = 0;
|
|
$res['msg'] = '请求有误';
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->doSetPaySet($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
}
|
|
|
|
/* 加载申请新大陆商户页面
|
|
* */
|
|
public function merchantEntry()
|
|
{
|
|
$merchant_id = I('get.merchant_id');
|
|
$open_type = I('get.open_type');
|
|
$this->assign('merchant_id', $merchant_id);
|
|
$this->assign('open_type', $open_type);
|
|
$this->display();
|
|
}
|
|
|
|
/**
|
|
* 获取初始新大陆进件信息
|
|
*/
|
|
public function initialNewPaySet()
|
|
{
|
|
// 判断登录
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->initialNewPaySet($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 已有新大陆商户,直接配置 Configurexdl
|
|
*/
|
|
public function customSettings()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$result = A('Api/RetailPaySet')->customSettings($merchant_id);
|
|
$this->ajaxReturn($result);
|
|
}
|
|
|
|
/**
|
|
* 获取经营类目
|
|
*/
|
|
public function getMccArr()
|
|
{
|
|
$res = A('Api/RetailPaySet')->getMccArr();
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 获取省列表
|
|
*/
|
|
public function getProvince()
|
|
{
|
|
$res = A('Api/RetailPaySet')->getProvince();
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 获取市列表
|
|
*/
|
|
public function getSubordinate()
|
|
{
|
|
// 接收参数
|
|
$p_id = I('post.p_id');
|
|
if (!$p_id) {
|
|
$res = array('status' => 0, 'msg' => '参数缺失');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->getSubordinate($p_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 获取区列表
|
|
*/
|
|
public function getArea()
|
|
{
|
|
// 接收参数
|
|
$province = I('post.province');
|
|
$city = I('post.city');
|
|
if (!$province || !$city) {
|
|
$res = array(
|
|
'status' => 0,
|
|
'msg' => '参数缺失'
|
|
);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->getArea();
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 获取银行信息
|
|
*/
|
|
public function getBank()
|
|
{
|
|
$res = A('Api/RetailPaySet')->getBank();
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 获取联行信息
|
|
*/
|
|
public function getWcLbnkNo()
|
|
{
|
|
$keyword = I('post.keyword');
|
|
$res = A('Api/RetailPaySet')->getWcLbnkNo($keyword);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 保存新大陆进件信息
|
|
*/
|
|
public function updateNewPaySet()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
// 接收参数
|
|
$data = I('post.data');
|
|
$step = I('post.step');
|
|
$res = A('Api/RetailPaySet')->updateNewPaySet($data, $step, $merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 第一次提交进件信息
|
|
*/
|
|
public function toIncomingParts()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->toIncomingParts($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 提交信息
|
|
*/
|
|
public function submitApply()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->submitApply($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 商户提交查询状态
|
|
*/
|
|
public function searchEntryApply()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->searchEntryApply($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 商户申请修改 商户通过时才能申请
|
|
*/
|
|
public function applyChange()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->applyChange($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
|
|
/**
|
|
* 删除商户新大陆支付配置
|
|
*/
|
|
public function deleteEntry()
|
|
{
|
|
$merchant_id = I('post.merchant_id');
|
|
if (!$merchant_id) {
|
|
$res = array('status' => 0, 'msg' => '请求有误');
|
|
$this->ajaxReturn($res);
|
|
}
|
|
$res = A('Api/RetailPaySet')->deleteEntry($merchant_id);
|
|
$this->ajaxReturn($res);
|
|
}
|
|
} |