init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace Common\Business;
|
||||
|
||||
use Common\Model\AgentPayConfigModel;
|
||||
use Common\Model\RetailPaySetModel;
|
||||
use Common\Model\RetailSmallProgramUserModel;
|
||||
|
||||
//[1.7.90]
|
||||
|
||||
/**
|
||||
* 公众号支付配置类型
|
||||
* Class PaySet
|
||||
* [
|
||||
* 获取商户支付模式及权限 basisMerchantIdGetInfo
|
||||
* 根据小程序用户id获取服务商公众号参数 getServiceSet
|
||||
* ]
|
||||
* @package Common\Business
|
||||
*/
|
||||
class PaySet
|
||||
{
|
||||
/**
|
||||
* 获取商户支付模式及权限
|
||||
* @param $merchant_id
|
||||
* @param $pay_type 支付方式 1微信 2支付宝 3微信小程序
|
||||
* @return mixed
|
||||
*/
|
||||
public function basisMerchantIdGetInfo($merchant_id, $pay_type)
|
||||
{
|
||||
try {
|
||||
$PaySetModel = new RetailPaySetModel();
|
||||
$result = $PaySetModel->getFindMerchantConfig($merchant_id, $pay_type);
|
||||
if ($result['status'] == 1) {
|
||||
return callBack(statusCode()['success'], "查询成功", $result);
|
||||
} else {
|
||||
return callBack(statusCode()['error'], $result['msg']);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return callBack(statusCode()['error'], "查询支付设置失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据小程序用户id获取服务商公众号参数
|
||||
* @param $param
|
||||
* [
|
||||
* xcx_id
|
||||
* user_type 1普通支付模式 2服务商支付模式
|
||||
* ]
|
||||
* @return mixed
|
||||
*/
|
||||
public function getServiceSet($param)
|
||||
{
|
||||
try {
|
||||
$xcxUserModel = new RetailSmallProgramUserModel();
|
||||
switch ($param['user_type']) {
|
||||
case 1:
|
||||
$paySet = $xcxUserModel->getMerchantPaySet('w.appid,w.appsecret,w.authorizer_appid,w.type', [
|
||||
'x.id' => $param['xcx_id']
|
||||
]);
|
||||
break;
|
||||
case 2:
|
||||
//服务商模式
|
||||
$agent = $xcxUserModel->getAgentPaySet('a.server_pay_state,a.id', [
|
||||
'x.id' => $param['xcx_id']
|
||||
]); //获取代理商公众号参数
|
||||
if ($agent['server_pay_state'] == 1) {
|
||||
//代理商的配置
|
||||
$paySetModel = new AgentPayConfigModel();
|
||||
$paySet = $paySetModel->getFind([
|
||||
'agent_id' => $agent['id']
|
||||
]);
|
||||
$paySet['appid'] = $paySet['wx_appid'];
|
||||
} else {
|
||||
//合伙人配置
|
||||
$paySet = M('partner_wxconfig')->find();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (empty($paySet)) {
|
||||
return callBack(statusCode()['error'], "未配置公众号");
|
||||
} else {
|
||||
return callBack(statusCode()['success'], "查询成功", ['paySet' => $paySet]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return callBack(statusCode()['error'], "未配置公众号");
|
||||
}
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户