Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
589b5f9e
ShopXO
项目概览
飞鱼0526
/
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,发现更多精彩内容 >>
提交
589b5f9e
编写于
2月 11, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用配置信息优化
上级
a4a04d00
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
65 addition
and
33 deletion
+65
-33
application/admin/controller/Plugins.php
application/admin/controller/Plugins.php
+1
-1
application/plugins/commontopmaxpicture/Commontopmaxpicture.php
...ation/plugins/commontopmaxpicture/Commontopmaxpicture.php
+10
-9
application/service/PluginsService.php
application/service/PluginsService.php
+48
-10
application/tags.php
application/tags.php
+4
-4
config/shopxo.sql
config/shopxo.sql
+2
-9
未找到文件。
application/admin/controller/Plugins.php
浏览文件 @
589b5f9e
...
...
@@ -80,7 +80,7 @@ class Plugins extends Common
);
$data
=
PluginsService
::
PluginsList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
return
$this
->
fetch
();
}
...
...
application/plugins/commontopmaxpicture/Commontopmaxpicture.php
浏览文件 @
589b5f9e
...
...
@@ -123,23 +123,24 @@ class Commontopmaxpicture extends Controller
{
// 基础信息
$base
=
[
'author'
=>
'Devil'
,
'blog'
=>
'http://gong.gg'
,
'name'
=>
'顶部广告'
,
'author'
=>
'Devil'
,
'author_url'
=>
'https://shopxo.net/'
,
'version'
=>
'1.0.0'
,
'desc'
=>
'顶部大图广告,突破视觉'
,
'apply_terminal'
=>
[
'pc'
],
'apply_version'
=>
[
'1.3.0'
],
'sales_amount'
=>
0
,
];
// 控制器钩子
$control_hook
=
[
'plugins_control_hook'
=>
[
'plugins_common_top'
=>
[
'app\\plugins\\commontopmaxpicture\\CommonTopMaxPicture'
],
],
// 钩子
$hook
=
[
'plugins_common_top'
=>
[
'app\\plugins\\commontopmaxpicture\\Commontopmaxpicture'
],
];
return
[
'base'
=>
$base
,
'
control_hook'
=>
$control_
hook
,
'base'
=>
$base
,
'
hook'
=>
$
hook
,
];
}
...
...
application/service/PluginsService.php
浏览文件 @
589b5f9e
...
...
@@ -55,21 +55,36 @@ class PluginsService
*/
private
static
function
PluginsDataHandle
(
$data
)
{
$result
=
[];
if
(
!
empty
(
$data
))
{
foreach
(
$data
as
&
$v
)
foreach
(
$data
as
$v
)
{
// 基础数据
$v
[
'logo_old'
]
=
$v
[
'logo'
];
$v
[
'logo'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'logo'
]);
$v
[
'apply_terminal'
]
=
empty
(
$v
[
'apply_terminal'
])
?
''
:
json_decode
(
$v
[
'apply_terminal'
],
true
);
// 时间
$v
[
'add_time_time'
]
=
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
$v
[
'add_time_date'
]
=
date
(
'Y-m-d'
,
$v
[
'add_time'
]);
$config
=
self
::
GetPluginsConfig
(
$v
[
'plugins'
]);
if
(
$config
!==
false
)
{
$base
=
$config
[
'base'
];
$result
[]
=
[
'id'
=>
$v
[
'id'
],
'plugins'
=>
$v
[
'plugins'
],
'logo_old'
=>
$v
[
'logo'
],
'logo'
=>
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'logo'
]),
'is_enable'
=>
$v
[
'is_enable'
],
'name'
=>
isset
(
$base
[
'name'
])
?
$base
[
'name'
]
:
''
,
'author'
=>
isset
(
$base
[
'author'
])
?
$base
[
'author'
]
:
''
,
'author_url'
=>
isset
(
$base
[
'author_url'
])
?
$base
[
'author_url'
]
:
''
,
'version'
=>
isset
(
$base
[
'version'
])
?
$base
[
'version'
]
:
''
,
'desc'
=>
isset
(
$base
[
'desc'
])
?
$base
[
'desc'
]
:
''
,
'apply_version'
=>
isset
(
$base
[
'apply_version'
])
?
$base
[
'apply_version'
]
:
[],
'apply_terminal'
=>
isset
(
$base
[
'apply_terminal'
])
?
$base
[
'apply_terminal'
]
:
[],
'add_time_time'
=>
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]),
'add_time_date'
=>
date
(
'Y-m-d'
,
$v
[
'add_time'
]),
];
}
}
}
return
$data
;
return
$result
;
}
/**
...
...
@@ -234,5 +249,28 @@ class PluginsService
return
DataReturn
(
'删除失败或资源不存在'
,
-
100
);
}
/**
* 获取应用配置信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-17
* @desc description
* @param [string] $plugins [应用名称]
*/
private
static
function
GetPluginsConfig
(
$plugins
)
{
$plugins
=
'\app\plugins\\'
.
$plugins
.
'\\'
.
ucfirst
(
$plugins
);
if
(
class_exists
(
$plugins
))
{
$obj
=
new
$plugins
();
if
(
method_exists
(
$obj
,
'config'
))
{
return
$obj
->
config
();
}
}
return
false
;
}
}
?>
\ No newline at end of file
application/tags.php
浏览文件 @
589b5f9e
<?php
// +----------------------------------------------------------------------
// |
ThinkPHP [ WE CAN DO IT JUST THINK ]
// |
ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 20
06~2018 http://thinkphp.cn
All rights reserved.
// | Copyright (c) 20
11~2018 http://shopxo.net
All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author:
liu21st <liu21st@gmail.com>
// | Author:
Devil
// +----------------------------------------------------------------------
// 应用行为扩展定义文件
...
...
@@ -27,6 +27,6 @@ return [
'app_end'
=>
[],
// 钩子测试
'plugins_common_top'
=>
[
'app\\plugins\\commontopmaxpicture\\Common
TopMaxP
icture'
],
'plugins_common_top'
=>
[
'app\\plugins\\commontopmaxpicture\\Common
topmaxp
icture'
],
];
?>
\ No newline at end of file
config/shopxo.sql
浏览文件 @
589b5f9e
...
...
@@ -9,7 +9,7 @@
Target Server Version : 50716
File Encoding : utf-8
Date: 02/
09/2019 14:49:2
0 PM
Date: 02/
11/2019 23:08:3
0 PM
*/
SET NAMES utf8;
...
...
@@ -808,16 +808,9 @@ CREATE TABLE `s_payment` (
DROP TABLE IF EXISTS `s_plugins`;
CREATE TABLE `s_plugins` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`name` char(30) NOT NULL COMMENT '名称',
`plugins` char(60) NOT NULL DEFAULT '' COMMENT '唯一标记',
`logo` char(255) NOT NULL DEFAULT '' COMMENT 'logo',
`version` char(255) NOT NULL DEFAULT '' COMMENT '版本',
`apply_version` char(255) NOT NULL DEFAULT '' COMMENT '适用系统版本',
`desc` char(255) NOT NULL DEFAULT '' COMMENT '描述',
`author` char(255) NOT NULL DEFAULT '' COMMENT '作者',
`author_url` char(255) NOT NULL DEFAULT '' COMMENT '作者主页',
`data` text COMMENT '应用数据',
`apply_terminal` char(255) NOT NULL COMMENT '适用终端 php一维数组json字符串存储(pc, wap, app, alipay, weixin, baidu)',
`is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
`upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
...
...
@@ -830,7 +823,7 @@ CREATE TABLE `s_plugins` (
-- Records of `s_plugins`
-- ----------------------------
BEGIN;
INSERT INTO `s_plugins` VALUES ('1', '
顶部大图广告', 'commontopmaxpicture', 'http://tp5-dev.com/static/upload/images/plugins_commontopmaxpicture/2019/02/09/1549671733987654.png', '1.0.0', '1.3.0', '顶部大图广告,突破视觉', 'Devil', 'https://shopxo.net/', '{\"images\":\"http:\\/\\/tp5-dev.com\\/static\\/upload\\/images\\/plugins_commontopmaxpicture\\/2019\\/02\\/09\\/1549671733978860.jpg\",\"bg_color\":\"#ce0000\",\"url\":\"https:\\/\\/shopxo.net\",\"is_new_window_open\":\"1\",\"is_overall\":\"1\",\"time_start\":\"\",\"time_end\":\"\"}', '{\\\"pc\\\"}', '1', '0', '1549694936
');
INSERT INTO `s_plugins` VALUES ('1', '
commontopmaxpicture', 'http://tp5-dev.com/static/upload/images/plugins_commontopmaxpicture/2019/02/09/1549671733987654.png', '{\"images\":\"http:\\/\\/tp5-dev.com\\/static\\/upload\\/images\\/plugins_commontopmaxpicture\\/2019\\/02\\/09\\/1549671733978860.jpg\",\"bg_color\":\"#ce0000\",\"url\":\"https:\\/\\/shopxo.net\",\"is_new_window_open\":\"1\",\"is_overall\":\"1\",\"time_start\":\"\",\"time_end\":\"\"}', '0', '0', '1549897473
');
COMMIT;
-- ----------------------------
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录