Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
ed9720a2
ShopXO
项目概览
jamesyang1999
/
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,体验更适合开发者的 AI 搜索 >>
提交
ed9720a2
编写于
3月 30, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用数据,商品大分类数据缓存
上级
eb48ca58
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
6 deletion
+13
-6
application/service/GoodsService.php
application/service/GoodsService.php
+3
-3
application/service/PluginsService.php
application/service/PluginsService.php
+4
-3
config/shopxo.php
config/shopxo.php
+6
-0
未找到文件。
application/service/GoodsService.php
浏览文件 @
ed9720a2
...
@@ -57,7 +57,7 @@ class GoodsService
...
@@ -57,7 +57,7 @@ class GoodsService
public
static
function
GoodsCategory
(
$params
=
[])
public
static
function
GoodsCategory
(
$params
=
[])
{
{
// 从缓存获取
// 从缓存获取
$key
=
'cache_goods_category_key_data'
;
$key
=
config
(
'shopxo.cache_goods_category_key'
)
;
$data
=
cache
(
$key
);
$data
=
cache
(
$key
);
if
(
!
empty
(
$data
))
if
(
!
empty
(
$data
))
{
{
...
@@ -2080,7 +2080,7 @@ class GoodsService
...
@@ -2080,7 +2080,7 @@ class GoodsService
if
(
Db
::
name
(
'GoodsCategory'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
(
$data
))
if
(
Db
::
name
(
'GoodsCategory'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
(
$data
))
{
{
// 删除大分类缓存
// 删除大分类缓存
cache
(
'cache_goods_category_key_data'
,
null
);
cache
(
config
(
'shopxo.cache_goods_category_key'
)
,
null
);
return
DataReturn
(
'编辑成功'
,
0
);
return
DataReturn
(
'编辑成功'
,
0
);
}
}
...
@@ -2125,7 +2125,7 @@ class GoodsService
...
@@ -2125,7 +2125,7 @@ class GoodsService
if
(
Db
::
name
(
'GoodsCategory'
)
->
where
([
'id'
=>
$ids
])
->
delete
())
if
(
Db
::
name
(
'GoodsCategory'
)
->
where
([
'id'
=>
$ids
])
->
delete
())
{
{
// 删除大分类缓存
// 删除大分类缓存
cache
(
'cache_goods_category_key_data'
,
null
);
cache
(
config
(
'shopxo.cache_goods_category_key'
)
,
null
);
return
DataReturn
(
'删除成功'
,
0
);
return
DataReturn
(
'删除成功'
,
0
);
}
}
...
...
application/service/PluginsService.php
浏览文件 @
ed9720a2
...
@@ -35,7 +35,8 @@ class PluginsService
...
@@ -35,7 +35,8 @@ class PluginsService
public
static
function
PluginsData
(
$plugins
,
$attachment_field
=
[])
public
static
function
PluginsData
(
$plugins
,
$attachment_field
=
[])
{
{
// 从缓存获取数据
// 从缓存获取数据
$data
=
cache
(
'cache_plugins_data_key_'
.
$plugins
);
$key
=
config
(
'shopxo.cache_plugins_data_key'
)
.
$plugins
;
$data
=
cache
(
$key
);
if
(
empty
(
$data
))
if
(
empty
(
$data
))
{
{
// 获取数据
// 获取数据
...
@@ -58,7 +59,7 @@ class PluginsService
...
@@ -58,7 +59,7 @@ class PluginsService
}
}
// 存储缓存
// 存储缓存
cache
(
'cache_plugins_data_key_'
.
$plugins
,
$data
);
cache
(
$key
,
$data
);
}
}
}
}
return
DataReturn
(
'处理成功'
,
0
,
$data
);
return
DataReturn
(
'处理成功'
,
0
,
$data
);
...
@@ -113,7 +114,7 @@ class PluginsService
...
@@ -113,7 +114,7 @@ class PluginsService
if
(
Db
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
$params
[
'plugins'
]])
->
update
([
'data'
=>
json_encode
(
$params
[
'data'
]),
'upd_time'
=>
time
()]))
if
(
Db
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
$params
[
'plugins'
]])
->
update
([
'data'
=>
json_encode
(
$params
[
'data'
]),
'upd_time'
=>
time
()]))
{
{
// 删除缓存
// 删除缓存
cache
(
'plugins_data_key_'
.
$params
[
'plugins'
],
null
);
cache
(
config
(
'shopxo.cache_plugins_data_key'
)
.
$params
[
'plugins'
],
null
);
return
DataReturn
(
'操作成功'
);
return
DataReturn
(
'操作成功'
);
}
}
...
...
config/shopxo.php
浏览文件 @
ed9720a2
...
@@ -30,6 +30,12 @@ return [
...
@@ -30,6 +30,12 @@ return [
// 前台顶部导航
// 前台顶部导航
'cache_common_home_nav_footer_key'
=>
'cache_common_home_nav_footer_data'
,
'cache_common_home_nav_footer_key'
=>
'cache_common_home_nav_footer_data'
,
// 商品大分类缓存
'cache_goods_category_key'
=>
'cache_goods_category_key_data'
,
// 应用数据缓存
'cache_plugins_data_key'
=>
'cache_plugins_data_key_data_'
,
// 附件host, 数据库图片地址以/static/...开头
// 附件host, 数据库图片地址以/static/...开头
'attachment_host'
=>
defined
(
'__MY_PUBLIC_URL__'
)
?
substr
(
__MY_PUBLIC_URL__
,
0
,
-
1
)
:
''
,
'attachment_host'
=>
defined
(
'__MY_PUBLIC_URL__'
)
?
substr
(
__MY_PUBLIC_URL__
,
0
,
-
1
)
:
''
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录