Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
u011369184
ShopXO
提交
455c7c1d
ShopXO
项目概览
u011369184
/
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,发现更多精彩内容 >>
提交
455c7c1d
编写于
7月 16, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
插件管理优化
上级
3cc3edcd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
34 deletion
+18
-34
application/admin/controller/Pluginsadmin.php
application/admin/controller/Pluginsadmin.php
+6
-8
application/admin/view/default/pluginsadmin/first_step.html
application/admin/view/default/pluginsadmin/first_step.html
+1
-1
application/admin/view/default/pluginsadmin/index.html
application/admin/view/default/pluginsadmin/index.html
+2
-2
application/admin/view/default/pluginsadmin/save_info.html
application/admin/view/default/pluginsadmin/save_info.html
+2
-2
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+7
-21
未找到文件。
application/admin/controller/Pluginsadmin.php
浏览文件 @
455c7c1d
...
...
@@ -92,14 +92,12 @@ class Pluginsadmin extends Common
if
(
!
empty
(
$params
[
'id'
]))
{
// 获取数据
$data_params
=
array
(
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
);
$ret
=
PluginsAdminService
::
PluginsList
(
$data_params
);
$data
=
$ret
[
'data'
][
0
];
$params
[
'plugins'
]
=
$ret
[
'data'
][
0
][
'plugins'
];
$ret
=
PluginsAdminService
::
PluginsList
();
if
(
isset
(
$ret
[
'data'
][
$params
[
'id'
]]))
{
$data
=
$ret
[
'data'
][
$params
[
'id'
]];
$params
[
'plugins'
]
=
$params
[
'id'
];
}
}
$this
->
assign
(
'data'
,
$data
);
...
...
application/admin/view/default/pluginsadmin/first_step.html
浏览文件 @
455c7c1d
...
...
@@ -13,7 +13,7 @@
应用编辑
{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/pluginsadmin/index'
, $params
)}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
<a
href=
"{{:MyUrl('admin/pluginsadmin/index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/pluginsadmin/index.html
浏览文件 @
455c7c1d
...
...
@@ -30,8 +30,8 @@
<div
class=
"am-gallery-desc"
>
{{$v.desc}}
</div>
<div
class=
"operation"
>
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<a
href=
"{{:MyUrl('admin/pluginsadmin/saveinfo', array('id'=>$v['
id
']))}}"
class=
"am-btn am-btn-default am-btn-xs am-radius am-icon-edit"
title=
"编辑"
></a>
<a
href=
"{{:MyUrl('admin/pluginsadmin/download', array('id'=>$v['
id
']))}}"
class=
"am-btn am-btn-default am-btn-xs am-radius am-icon-download"
title=
"打包"
></a>
<a
href=
"{{:MyUrl('admin/pluginsadmin/saveinfo', array('id'=>$v['
plugins
']))}}"
class=
"am-btn am-btn-default am-btn-xs am-radius am-icon-edit"
title=
"编辑"
></a>
<a
href=
"{{:MyUrl('admin/pluginsadmin/download', array('id'=>$v['
plugins
']))}}"
class=
"am-btn am-btn-default am-btn-xs am-radius am-icon-download"
title=
"打包"
></a>
{{/if}}
{{if isset($v['is_install']) and $v['is_install'] eq 1}}
...
...
application/admin/view/default/pluginsadmin/save_info.html
浏览文件 @
455c7c1d
...
...
@@ -4,7 +4,7 @@
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/pluginsadmin/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/pluginsadmin/index'
, $params
)}}"
enctype=
"multipart/form-data"
>
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/pluginsadmin/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/pluginsadmin/index')}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"fs-16"
>
{{if empty($data['id'])}}
...
...
@@ -13,7 +13,7 @@
应用编辑
{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/pluginsadmin/index'
, $params
)}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
<a
href=
"{{:MyUrl('admin/pluginsadmin/index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/service/PluginsAdminService.php
浏览文件 @
455c7c1d
...
...
@@ -56,8 +56,8 @@ class PluginsAdminService
// 数据组装
$base
=
$config
[
'base'
];
$data
[]
=
[
'id'
=>
date
(
'YmdHis'
)
.
GetNumberCode
(
8
)
,
$data
[
$config
[
'base'
][
'plugins'
]
]
=
[
'id'
=>
empty
(
$db_config
[
'id'
])
?
date
(
'YmdHis'
)
.
GetNumberCode
(
8
)
:
$db_config
[
'id'
]
,
'plugins'
=>
isset
(
$base
[
'plugins'
])
?
$base
[
'plugins'
]
:
''
,
'is_enable'
=>
isset
(
$db_config
[
'is_enable'
])
?
$db_config
[
'is_enable'
]
:
0
,
'is_install'
=>
empty
(
$db_config
)
?
0
:
1
,
...
...
@@ -144,7 +144,7 @@ class PluginsAdminService
Db
::
startTrans
();
// 开始卸载
if
(
db
(
'Plugins'
)
->
where
([
'plugins'
=>
$params
[
'id'
]])
->
delete
())
if
(
DB
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
$params
[
'id'
]])
->
delete
())
{
// 钩子部署
$ret
=
self
::
PluginsHookDeployment
();
...
...
@@ -154,11 +154,13 @@ class PluginsAdminService
Db
::
commit
();
return
DataReturn
(
'卸载成功'
);
}
}
else
{
$ret
=
DataReturn
(
'卸载失败'
,
-
100
);
}
// 事务回退
Db
::
rollback
();
return
DataReturn
(
'卸载失败'
,
-
100
)
;
return
$ret
;
}
/**
...
...
@@ -502,17 +504,6 @@ class PluginsAdminService
return
$ret
;
}
// 应用是否已存在数据库
$plugins_id
=
Db
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
$plugins
])
->
value
(
'id'
);
if
(
empty
(
$plugins_id
))
{
$plugins_id
=
Db
::
name
(
'Plugins'
)
->
insertGetId
([
'plugins'
=>
$plugins
,
'is_enable'
=>
0
,
'add_time'
=>
time
()]);
if
(
empty
(
$plugins_id
))
{
return
DataReturn
(
'应用添加失败'
,
-
100
);
}
}
// 应用目录不存在则创建
$app_dir
=
APP_PATH
.
'plugins'
.
DS
.
$plugins
;
if
(
\
base\FileUtil
::
CreateDir
(
$app_dir
)
!==
true
)
...
...
@@ -1129,12 +1120,7 @@ php;
}
// 获取应用标记
$where
=
[
'id'
=>
intval
(
$params
[
'id'
])];
$plugins
=
Db
::
name
(
'Plugins'
)
->
where
(
$where
)
->
value
(
'plugins'
);
if
(
empty
(
$plugins
))
{
return
DataReturn
(
'应用不存在'
,
-
10
);
}
$plugins
=
$params
[
'id'
];
// 目录不存在则创建
$new_dir
=
ROOT
.
'runtime'
.
DS
.
'data'
.
DS
.
'plugins_package'
.
DS
.
$plugins
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录