微信/QQ支付支持APP
parent
1e4c5d60c8
commit
02d2fc4491
|
|
@ -3,6 +3,14 @@
|
|||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- 顶部提示信息 -->
|
||||
{{if !empty($site_store_info) and !empty($site_store_info['base']) and !empty($site_store_info['base']['site_top_notice'])}}
|
||||
<div class="am-alert am-alert-danger" data-am-alert>
|
||||
<button type="button" class="am-close">×</button>
|
||||
<p>{{$site_store_info.base.site_top_notice|raw}}</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 顶部基础信息 -->
|
||||
<div class="block-container base-content-top am-nbfc">
|
||||
<div class="am-fl am-nbfc left-content">
|
||||
|
|
|
|||
|
|
@ -43,6 +43,14 @@
|
|||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_search_is_keywords_seo_fields.name}}<span class="am-form-group-label-tips">{{$data.home_search_is_keywords_seo_fields.describe}}</span></label>
|
||||
<select name="{{$data.home_search_is_keywords_seo_fields.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.home_search_is_keywords_seo_fields.error_tips}}" required>
|
||||
{{foreach $common_is_text_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['home_search_is_keywords_seo_fields']['value']) and $data['home_search_is_keywords_seo_fields']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_search_is_brand.name}}<span class="am-form-group-label-tips">{{$data.home_search_is_brand.describe}}</span></label>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\service\SystemBaseService;
|
||||
|
||||
/**
|
||||
* 协议
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Agreement extends Common
|
||||
{
|
||||
/**
|
||||
* 构造方法
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-11-30
|
||||
* @desc description
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-05-16
|
||||
* @desc description
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
return SystemBaseService::AgreementData($this->data_request);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name":"默认主题",
|
||||
"ver":"2.0.1",
|
||||
"ver":"2.0.2",
|
||||
"author":"Devil",
|
||||
"home":"https://shopxo.net/"
|
||||
}
|
||||
|
|
@ -34,6 +34,7 @@ return [
|
|||
'1.9.3' => ['value' => '1.9.3', 'name' => 'v1.9.3'],
|
||||
'2.0.0' => ['value' => '2.0.0', 'name' => 'v2.0.0'],
|
||||
'2.0.1' => ['value' => '2.0.1', 'name' => 'v2.0.1'],
|
||||
'2.0.2' => ['value' => '2.0.2', 'name' => 'v2.0.2'],
|
||||
],
|
||||
|
||||
// 用户注册类型列表
|
||||
|
|
|
|||
|
|
@ -160,10 +160,15 @@ class SearchService
|
|||
$where_keywords = [];
|
||||
if(!empty($params['wd']))
|
||||
{
|
||||
$keywords_fields = 'g.title|g.simple_desc';
|
||||
if(MyC('home_search_is_keywords_seo_fields') == 1)
|
||||
{
|
||||
$keywords_fields .= '|g.seo_title|g.seo_keywords|g.seo_desc';
|
||||
}
|
||||
$keywords = explode(' ', $params['wd']);
|
||||
foreach($keywords as $kv)
|
||||
{
|
||||
$where_keywords[] = ['g.title|g.simple_desc', 'like', '%'.$kv.'%'];
|
||||
$where_keywords[] = [$keywords_fields, 'like', '%'.$kv.'%'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use think\facade\Hook;
|
|||
use app\service\ResourcesService;
|
||||
use app\service\QuickNavService;
|
||||
use app\service\PluginsService;
|
||||
use app\service\ConfigService;
|
||||
|
||||
/**
|
||||
* 系统基础公共信息服务层
|
||||
|
|
@ -328,5 +329,34 @@ class SystemBaseService
|
|||
// 返回状态、默认支持
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 协议数据
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2021-04-25
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AgreementData($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'document',
|
||||
'error_msg' => '协议文档类型有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 获取内容
|
||||
return ConfigService::ConfigContentRow('common_agreement_'.$params['document']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -38,6 +38,7 @@ return array (
|
|||
1 => 'app\\plugins\\shop\\Hook',
|
||||
2 => 'app\\plugins\\multilingual\\Hook',
|
||||
3 => 'app\\plugins\\store\\Hook',
|
||||
4 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_js' =>
|
||||
array (
|
||||
|
|
@ -45,6 +46,7 @@ return array (
|
|||
1 => 'app\\plugins\\shop\\Hook',
|
||||
2 => 'app\\plugins\\multilingual\\Hook',
|
||||
3 => 'app\\plugins\\store\\Hook',
|
||||
4 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_navigation_header_handle' =>
|
||||
array (
|
||||
|
|
@ -56,36 +58,44 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\multilingual\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_h5' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\multilingual\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_weixin' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_alipay' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_baidu' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_qq' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_toutiao' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_goods_handle_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\shop\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_buy_form_inside' =>
|
||||
array (
|
||||
|
|
@ -107,12 +117,14 @@ return array (
|
|||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\shop\\Hook',
|
||||
2 => 'app\\plugins\\store\\Hook',
|
||||
3 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_order_status_change_history_success_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
1 => 'app\\plugins\\shop\\Hook',
|
||||
2 => 'app\\plugins\\store\\Hook',
|
||||
3 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_base_data_return_api_buy_index' =>
|
||||
array (
|
||||
|
|
@ -128,12 +140,14 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\shop\\Hook',
|
||||
1 => 'app\\plugins\\store\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_header_navigation_top_right_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\shop\\Hook',
|
||||
1 => 'app\\plugins\\multilingual\\Hook',
|
||||
2 => 'app\\plugins\\store\\Hook',
|
||||
3 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_goods_save_handle' =>
|
||||
array (
|
||||
|
|
@ -177,6 +191,7 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\shop\\Hook',
|
||||
1 => 'app\\plugins\\store\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_admin_goods_save' =>
|
||||
array (
|
||||
|
|
@ -252,5 +267,37 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\store\\Hook',
|
||||
),
|
||||
'plugins_service_site_extraction_address_list' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_extends_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_admin_user_save' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_user_save_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_base' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_panel_price_top' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_module_form_admin_user_index' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_module_form_admin_user_detail' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
|
@ -2,7 +2,9 @@
|
|||
ShopXO 2.0.2 Release 000000 http://shopxo.net
|
||||
+=========================================================+
|
||||
全局
|
||||
1.
|
||||
1. 搜索关键字包含SEO字段新增开关
|
||||
2. api接口新增用户注册协议数据
|
||||
3. 微信/QQ支付支持APP支付独立配置appid
|
||||
|
||||
web端
|
||||
1. 系统、功能插件、支付插件、web端主题、小程序主题支持在线安装更新
|
||||
|
|
|
|||
|
|
@ -60,6 +60,16 @@ class QQ
|
|||
|
||||
// 配置信息
|
||||
$element = [
|
||||
[
|
||||
'element' => 'input',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'name' => 'app_appid',
|
||||
'placeholder' => '开放平台AppID',
|
||||
'title' => '开放平台AppID',
|
||||
'is_required' => 0,
|
||||
'message' => '请填写QQ开放平台APP支付分配的AppID',
|
||||
],
|
||||
[
|
||||
'element' => 'input',
|
||||
'type' => 'text',
|
||||
|
|
@ -250,7 +260,7 @@ class QQ
|
|||
// APP支付
|
||||
case 'APP' :
|
||||
$pay_data = array(
|
||||
'appid' => $this->pay_params['appid'],
|
||||
'appid' => $this->pay_params['app_appid'],
|
||||
'partnerid' => $this->pay_params['mch_id'],
|
||||
'prepayid' => $data['prepay_id'],
|
||||
'package' => 'Sign=WXPay',
|
||||
|
|
@ -275,7 +285,11 @@ class QQ
|
|||
*/
|
||||
private function GetPayParams($params = [])
|
||||
{
|
||||
$trade_type = empty($params['trade_type']) ? $this->GetTradeType() : $params['trade_type'];
|
||||
// 平台
|
||||
$client_type = ApplicationClientType();
|
||||
|
||||
// 支付类型
|
||||
$trade_type = empty($params['trade_type']) ? $this->GetTradeType($client_type) : $params['trade_type'];
|
||||
if(empty($trade_type))
|
||||
{
|
||||
return DataReturn('支付类型不匹配', -1);
|
||||
|
|
@ -284,9 +298,12 @@ class QQ
|
|||
// 异步地址处理
|
||||
$notify_url = (__MY_HTTP__ == 'https' && isset($this->config['agreement']) && $this->config['agreement'] == 1) ? 'http'.mb_substr($params['notify_url'], 5, null, 'utf-8') : $params['notify_url'];
|
||||
|
||||
// appid
|
||||
$appid = $this->PayAppID($client_type);
|
||||
|
||||
// 请求参数
|
||||
$data = [
|
||||
'appid' => $this->config['appid'],
|
||||
'appid' => $appid,
|
||||
'mch_id' => $this->config['mch_id'],
|
||||
'nonce_str' => md5(time().$params['order_no']),
|
||||
'body' => $params['site_name'].'-'.$params['name'],
|
||||
|
|
@ -302,19 +319,34 @@ class QQ
|
|||
return DataReturn('success', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* appid获取
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2021-04-25
|
||||
* @desc description
|
||||
* @param [string] $client_type [客户端类型]
|
||||
*/
|
||||
public function PayAppID($client_type)
|
||||
{
|
||||
$arr = [
|
||||
'app' => $this->config['app_appid'],
|
||||
];
|
||||
return array_key_exists($client_type, $arr) ? $arr[$client_type] : $this->config['appid'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付交易类型
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-01-08
|
||||
* @param [string] $client_type [客户端类型]
|
||||
* @desc description
|
||||
*/
|
||||
private function GetTradeType()
|
||||
private function GetTradeType($client_type)
|
||||
{
|
||||
// 平台
|
||||
$client_type = ApplicationClientType();
|
||||
|
||||
// 平台类型定义
|
||||
$type_all = [
|
||||
'pc' => 'NATIVE',
|
||||
|
|
@ -410,7 +442,7 @@ class QQ
|
|||
|
||||
// 请求参数
|
||||
$data = [
|
||||
'appid' => $this->config['appid'],
|
||||
'appid' => $this->PayAppID($params['client_type']),
|
||||
'mch_id' => $this->config['mch_id'],
|
||||
'nonce_str' => md5(time().rand().$params['order_no']),
|
||||
'transaction_id' => $params['trade_no'],
|
||||
|
|
|
|||
|
|
@ -60,6 +60,16 @@ class Weixin
|
|||
|
||||
// 配置信息
|
||||
$element = [
|
||||
[
|
||||
'element' => 'input',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'name' => 'app_appid',
|
||||
'placeholder' => '开放平台AppID',
|
||||
'title' => '开放平台AppID',
|
||||
'is_required' => 0,
|
||||
'message' => '请填写微信开放平台APP支付分配的AppID',
|
||||
],
|
||||
[
|
||||
'element' => 'input',
|
||||
'type' => 'text',
|
||||
|
|
@ -370,7 +380,7 @@ class Weixin
|
|||
}
|
||||
|
||||
// appid
|
||||
$appid = ($client_type == 'weixin') ? $this->config['mini_appid'] : $this->config['appid'];
|
||||
$appid = $this->PayAppID($client_type);
|
||||
|
||||
// 异步地址处理
|
||||
$notify_url = ($client_type == 'qq') ? 'https://api.q.qq.com/wxpay/notify' : $this->GetNotifyUrl($params);
|
||||
|
|
@ -395,6 +405,24 @@ class Weixin
|
|||
return DataReturn('success', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* appid获取
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2021-04-25
|
||||
* @desc description
|
||||
* @param [string] $client_type [客户端类型]
|
||||
*/
|
||||
public function PayAppID($client_type)
|
||||
{
|
||||
$arr = [
|
||||
'weixin' => $this->config['mini_appid'],
|
||||
'app' => $this->config['app_appid'],
|
||||
];
|
||||
return array_key_exists($client_type, $arr) ? $arr[$client_type] : $this->config['appid'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单自动关闭的时间
|
||||
* @author Devil
|
||||
|
|
@ -546,7 +574,7 @@ class Weixin
|
|||
$refund_reason = empty($params['refund_reason']) ? $params['order_no'].'订单退款'.$params['refund_price'].'元' : $params['refund_reason'];
|
||||
|
||||
// appid,默认使用公众号appid
|
||||
$appid = (!isset($params['client_type']) || in_array($params['client_type'], ['pc', 'h5'])) ? $this->config['appid'] : $this->config['mini_appid'];
|
||||
$appid = $this->PayAppID($params['client_type']);
|
||||
|
||||
// 请求参数
|
||||
$data = [
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
if(version_compare(PHP_VERSION,'5.6.0','<')) die('PHP版本最低 5.6.0');
|
||||
|
||||
// 系统版本
|
||||
define('APPLICATION_VERSION', 'v2.0.1');
|
||||
define('APPLICATION_VERSION', 'v2.0.2');
|
||||
|
||||
// 定义系统目录分隔符
|
||||
define('DS', '/');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name":"默认主题",
|
||||
"ver":"2.0.1",
|
||||
"ver":"2.0.2",
|
||||
"author":"Devil",
|
||||
"home":"https://shopxo.net/"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name":"默认主题",
|
||||
"ver":"2.0.1",
|
||||
"ver":"2.0.2",
|
||||
"author":"Devil",
|
||||
"home":"https://shopxo.net/"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name":"默认主题",
|
||||
"ver":"2.0.1",
|
||||
"ver":"2.0.2",
|
||||
"author":"Devil",
|
||||
"home":"https://shopxo.net/"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name":"默认主题",
|
||||
"ver":"2.0.1",
|
||||
"ver":"2.0.2",
|
||||
"author":"Devil",
|
||||
"home":"https://shopxo.net/"
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name":"默认主题",
|
||||
"ver":"2.0.1",
|
||||
"ver":"2.0.2",
|
||||
"author":"Devil",
|
||||
"home":"https://shopxo.net/"
|
||||
}
|
||||
Loading…
Reference in New Issue