You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
676 lines
15 KiB
676 lines
15 KiB
<?php
|
|
// 三方配置类
|
|
|
|
/**
|
|
* 获取微信公众号配置
|
|
* @date 2022-10-26
|
|
*/
|
|
function get_weixin_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformWeixin(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getWeixinPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取微信小程序配置
|
|
* @date 2022-10-26
|
|
*/
|
|
function get_mp_weixin_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformWeixin(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getMpWeixinPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取微信移动应用配置
|
|
* @date 2022-10-26
|
|
*/
|
|
function get_app_weixin_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformWeixin(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getAppWeixinPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取微信支付配置
|
|
* @date 2022-10-26
|
|
*/
|
|
function get_wxpay_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformWxpay(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取不同平台微信支付参数 组合APP_ID
|
|
* @date 2022-10-28
|
|
*/
|
|
function get_wxpay_config_with_weixin($user_agent, $uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$wxpay_param = get_wxpay_config($uid);
|
|
|
|
switch ($user_agent) {
|
|
// app
|
|
case 'app':
|
|
$weixin_param = get_weixin_config($uid);
|
|
$wxpay_param['app_id'] = $weixin_param['app_id'];
|
|
break;
|
|
// 小程序
|
|
case 'mp_weixin':
|
|
$mp_weixin_param = get_mp_weixin_config($uid);
|
|
$wxpay_param['app_id'] = $mp_weixin_param['app_id'];
|
|
break;
|
|
// 公众号
|
|
case 'weixin':
|
|
$weixin_param = get_weixin_config($uid);
|
|
$wxpay_param['app_id'] = $weixin_param['app_id'];
|
|
break;
|
|
// H5 H5支付用的是公众号的app_id
|
|
case 'h5':
|
|
$weixin_param = get_weixin_config($uid);
|
|
$wxpay_param['app_id'] = $weixin_param['app_id'];
|
|
break;
|
|
// 其他情况
|
|
default:
|
|
break;
|
|
}
|
|
return $wxpay_param;
|
|
}
|
|
|
|
/**
|
|
* 获取qq小程序配置
|
|
* @date 2022-12-07
|
|
*/
|
|
function get_mp_qq_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformMpQq(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取支付宝小程序配置
|
|
* @date 2022-11-01
|
|
*/
|
|
function get_mp_alipay_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAlipay(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getMpAlipayPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取支付宝移动应用微信配置
|
|
* @date 2022-11-01
|
|
*/
|
|
function get_app_alipay_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAlipay(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getAppAlipayPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取支付宝网站应用微信配置
|
|
* @date 2022-11-01
|
|
*/
|
|
function get_h5_alipay_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAlipay(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getH5AlipayPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取抖音配置
|
|
* @date 2022-10-19
|
|
*/
|
|
function get_mp_toutiao_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformMpToutiao(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取付呗三方支付平台配置
|
|
* @date 2022-10-28
|
|
*/
|
|
function get_fubei_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformFubei(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取易生三方支付平台配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_yisheng_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformYisheng(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取快递鸟平台配置
|
|
* @date 2022-11-21
|
|
*/
|
|
function get_kdniao_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformKdniao(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取自习室平台配置
|
|
* @date 2022-11-21
|
|
*/
|
|
function get_zixishi_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformZixishi(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取腾讯云短信平台配置
|
|
* @date 2022-11-28
|
|
*/
|
|
function get_tencent_message_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformTencentMessage(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取腾讯云COS平台配置
|
|
* @date 2022-11-28
|
|
*/
|
|
function get_tencent_cos_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformTencentCos(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取腾讯云平台语音合成配置
|
|
* @date 2022-12-06
|
|
*/
|
|
function get_tencent_tts_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformTencentTts(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取腾讯云平台语音识别配置
|
|
* @date 2022-12-06
|
|
*/
|
|
function get_tencent_asr_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformTencentAsr(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取腾讯云平台地图配置
|
|
* @date 2022-12-06
|
|
*/
|
|
function get_tencent_map_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformTencentMap(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云OSS平台配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_ali_oss_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliOss(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云OSS平台配置
|
|
* @date 2022-12-07
|
|
*/
|
|
function get_ali_live_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliLive(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云短信平台配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_ali_message_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliMessage(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云号码隐私平台配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_ali_phonenumber_protection_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliPhonenumberProtection(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取阿里云平台语音服务配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_ali_voice_messaging_service_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliVoiceMessagingService(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云平台分词配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_ali_elastic_search_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliElasticSearch(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云平台弯管配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_ali_api_gateway_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliApiGateway(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取阿里云智能平台配置
|
|
* @date 2022-12-15
|
|
*/
|
|
function get_ali_ivision_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformAliIvision(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取聚合数据平台短信配置
|
|
* @date 2022-12-05
|
|
*/
|
|
function get_juhe_message_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformJuheMessage(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取腾讯云平台地图配置
|
|
* @date 2022-12-06
|
|
*/
|
|
function get_xunfei_ise_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformXunfeiIse(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取dcloud uniPush配置
|
|
* @date 2022-12-07
|
|
*/
|
|
function get_dcloud_uni_push_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformDcloudUniPush(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 获取websocket配置
|
|
* @date 2022-12-07
|
|
*/
|
|
function get_websocket_config($uid = '')
|
|
{
|
|
if (!$uid) {
|
|
$uid = defined('UID') ? UID : '';
|
|
}
|
|
|
|
$platform_model = new \app\base\model\platform\PlatformWebsocket(['uid' => $uid]);
|
|
|
|
// 获取平台参数
|
|
$platform_param = $platform_model->getPlatformParam();
|
|
|
|
// 转为数组
|
|
$result = empty($platform_param) ? [] : $platform_param->toArray();
|
|
|
|
return $result;
|
|
} |