Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
1fcaa327
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1fcaa327
编写于
7月 25, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
协议管理优化
上级
cfcd94cf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
97 addition
and
57 deletion
+97
-57
app/api/controller/Agreement.php
app/api/controller/Agreement.php
+2
-2
app/index/controller/Agreement.php
app/index/controller/Agreement.php
+9
-6
app/service/AgreementService.php
app/service/AgreementService.php
+54
-0
app/service/ConfigService.php
app/service/ConfigService.php
+32
-19
app/service/SystemBaseService.php
app/service/SystemBaseService.php
+0
-30
未找到文件。
app/api/controller/Agreement.php
浏览文件 @
1fcaa327
...
...
@@ -11,7 +11,7 @@
namespace
app\api\controller
;
use
app\service\ApiService
;
use
app\service\
SystemBase
Service
;
use
app\service\
Agreement
Service
;
/**
* 协议
...
...
@@ -45,7 +45,7 @@ class Agreement extends Common
*/
public
function
Index
()
{
return
ApiService
::
ApiDataReturn
(
SystemBase
Service
::
AgreementData
(
$this
->
data_request
));
return
ApiService
::
ApiDataReturn
(
Agreement
Service
::
AgreementData
(
$this
->
data_request
));
}
}
?>
\ No newline at end of file
app/index/controller/Agreement.php
浏览文件 @
1fcaa327
...
...
@@ -10,8 +10,8 @@
// +----------------------------------------------------------------------
namespace
app\index\controller
;
use
app\service\ConfigService
;
use
app\service\SeoService
;
use
app\service\AgreementService
;
/**
* 协议
...
...
@@ -52,15 +52,18 @@ class Agreement extends Common
$data
=
[];
if
(
!
empty
(
$params
[
'document'
]))
{
$key
=
'common_agreement_'
.
$params
[
'document'
];
$ret
=
ConfigService
::
ConfigContentRow
(
$key
);
// 获取协议内容
$ret
=
AgreementService
::
AgreementData
(
$params
);
// 浏览器标题
if
(
!
empty
(
$ret
[
'data'
]
[
'name'
]
))
if
(
!
empty
(
$ret
[
'data'
]))
{
MyViewAssign
(
'home_seo_site_title'
,
SeoService
::
BrowserSeoTitle
(
$ret
[
'data'
][
'name'
]));
if
(
!
empty
(
$ret
[
'data'
][
'name'
]))
{
MyViewAssign
(
'home_seo_site_title'
,
SeoService
::
BrowserSeoTitle
(
$ret
[
'data'
][
'name'
]));
}
$data
=
$ret
[
'data'
];
}
$data
=
$ret
[
'data'
];
}
// 是否仅展示内容
...
...
app/service/AgreementService.php
0 → 100644
浏览文件 @
1fcaa327
<?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\service
;
use
app\service\ConfigService
;
/**
* 协议服务层
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-07-25
* @desc description
*/
class
AgreementService
{
/**
* 协议数据
* @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'
]);
}
}
?>
\ No newline at end of file
app/service/ConfigService.php
浏览文件 @
1fcaa327
...
...
@@ -22,25 +22,30 @@ use app\service\ResourcesService;
*/
class
ConfigService
{
// 不参与缓存的配置
public
static
$not_cache_field_list
=
[
'common_agreement_userregister'
,
'common_agreement_userprivacy'
,
];
// 富文本,不实例化的字段
public
static
$rich_text_list
=
[
'home_footer_info'
,
'common_email_currency_template'
,
'home_email_user_reg'
,
'home_email_user_forget_pwd'
,
'home_email_user_email_binding'
,
'home_site_close_reason'
,
'common_agreement_userregister'
,
'common_agreement_userprivacy'
,
'common_self_extraction_address'
,
'home_index_floor_top_right_keywords'
,
'home_index_floor_manual_mode_goods'
,
'home_index_floor_left_top_category'
,
'admin_email_login_template'
,
'home_email_login_template'
,
'home_site_security_record_url'
,
'layout_index_home_data'
,
];
'common_agreement_userregister'
,
'common_agreement_userprivacy'
,
'common_email_currency_template'
,
'home_footer_info'
,
'home_email_user_reg'
,
'home_email_user_forget_pwd'
,
'home_email_user_email_binding'
,
'home_site_close_reason'
,
'common_self_extraction_address'
,
'home_index_floor_top_right_keywords'
,
'home_index_floor_manual_mode_goods'
,
'home_index_floor_left_top_category'
,
'admin_email_login_template'
,
'home_email_login_template'
,
'home_site_security_record_url'
,
];
// 附件字段列表
public
static
$attachment_field_list
=
[
...
...
@@ -186,6 +191,7 @@ class ConfigService
// 单条配置缓存删除
MyCache
(
$k
,
null
);
MyCache
(
$k
.
'_row_data'
,
null
);
}
}
if
(
$success
>
0
)
...
...
@@ -265,6 +271,12 @@ class ConfigService
// 数据处理
foreach
(
$data
as
$k
=>&
$v
)
{
// 不参与缓存的配置
if
(
in_array
(
$k
,
self
::
$not_cache_field_list
))
{
continue
;
}
// 富文本字段处理
if
(
in_array
(
$k
,
self
::
$rich_text_list
))
{
...
...
@@ -361,7 +373,8 @@ class ConfigService
*/
public
static
function
ConfigContentRow
(
$key
)
{
$data
=
MyCache
(
$key
);
$cache_key
=
$key
.
'_row_data'
;
$data
=
MyCache
(
$cache_key
);
if
(
$data
===
null
)
{
$data
=
Db
::
name
(
'Config'
)
->
where
([
'only_tag'
=>
$key
])
->
field
(
'name,value,type,upd_time'
)
->
find
();
...
...
@@ -376,7 +389,7 @@ class ConfigService
}
else
{
$data
=
[];
}
MyCache
(
$key
,
$data
);
MyCache
(
$
cache_
key
,
$data
);
}
return
DataReturn
(
'操作成功'
,
0
,
$data
);
...
...
app/service/SystemBaseService.php
浏览文件 @
1fcaa327
...
...
@@ -14,7 +14,6 @@ use think\facade\Db;
use
app\service\ResourcesService
;
use
app\service\QuickNavService
;
use
app\service\PluginsService
;
use
app\service\ConfigService
;
/**
* 系统基础公共信息服务层
...
...
@@ -445,35 +444,6 @@ 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'
]);
}
/**
* 附件地址
* @author Devil
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录