Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
86760a49
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,发现更多精彩内容 >>
提交
86760a49
编写于
8月 01, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
后台新增数据新增钩子
上级
ade84ca0
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
148 addition
and
26 deletion
+148
-26
application/admin/controller/Admin.php
application/admin/controller/Admin.php
+16
-1
application/admin/controller/Article.php
application/admin/controller/Article.php
+14
-3
application/admin/controller/Goods.php
application/admin/controller/Goods.php
+4
-3
application/admin/controller/Power.php
application/admin/controller/Power.php
+16
-2
application/admin/controller/User.php
application/admin/controller/User.php
+4
-3
application/admin/view/default/admin/save_info.html
application/admin/view/default/admin/save_info.html
+21
-0
application/admin/view/default/article/save_info.html
application/admin/view/default/article/save_info.html
+21
-1
application/admin/view/default/power/role_save_info.html
application/admin/view/default/power/role_save_info.html
+20
-0
application/tags.php
application/tags.php
+32
-13
未找到文件。
application/admin/controller/Admin.php
浏览文件 @
86760a49
...
...
@@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace
app\admin\controller
;
use
think\facade\Hook
;
use
app\service\AdminService
;
/**
...
...
@@ -132,7 +133,6 @@ class Admin extends Common
}
$data
=
$ret
[
0
];
}
$this
->
assign
(
'data'
,
$data
);
// 角色
$role_params
=
[
...
...
@@ -143,6 +143,21 @@ class Admin extends Common
$this
->
assign
(
'id'
,
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
);
$this
->
assign
(
'common_gender_list'
,
lang
(
'common_gender_list'
));
// 管理员编辑页面钩子
$hook_name
=
'plugins_view_admin_admin_save'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
,
'data'
=>
&
$data
,
'params'
=>
&
$params
,
]));
// 数据
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
();
}
...
...
application/admin/controller/Article.php
浏览文件 @
86760a49
...
...
@@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace
app\admin\controller
;
use
think\facade\Hook
;
use
app\service\ArticleService
;
/**
...
...
@@ -123,7 +124,6 @@ class Article extends Common
$ret
=
ArticleService
::
ArticleList
(
$data_params
);
$data
=
empty
(
$ret
[
'data'
][
0
])
?
[]
:
$ret
[
'data'
][
0
];
}
$this
->
assign
(
'data'
,
$data
);
// 是否启用
$this
->
assign
(
'common_is_enable_list'
,
lang
(
'common_is_enable_list'
));
...
...
@@ -132,12 +132,23 @@ class Article extends Common
$article_category
=
ArticleService
::
ArticleCategoryList
([
'field'
=>
'id,name'
]);
$this
->
assign
(
'article_category_list'
,
$article_category
[
'data'
]);
// 参数
$this
->
assign
(
'params'
,
$params
);
// 文章编辑页面钩子
$hook_name
=
'plugins_view_admin_article_save'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
,
'data'
=>
&
$data
,
'params'
=>
&
$params
,
]));
// 编辑器文件存放地址
$this
->
assign
(
'editor_path_type'
,
'article'
);
// 数据
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
();
}
...
...
application/admin/controller/Goods.php
浏览文件 @
86760a49
...
...
@@ -145,11 +145,12 @@ class Goods extends Common
$this
->
assign
(
'goods_specifications_extends'
,
$goods_spec_extends
[
'data'
]);
// 商品编辑页面钩子
$this
->
assign
(
'plugins_view_admin_goods_save_data'
,
Hook
::
listen
(
'plugins_view_admin_goods_save'
,
$hook_name
=
'plugins_view_admin_goods_save'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
'plugins_view_admin_goods_save'
,
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
$params
[
'id'
]
,
'goods_id'
=>
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
,
'data'
=>
&
$data
,
'params'
=>
&
$params
,
]));
...
...
application/admin/controller/Power.php
浏览文件 @
86760a49
...
...
@@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace
app\admin\controller
;
use
think\facade\Hook
;
use
app\service\AdminPowerService
;
/**
...
...
@@ -149,13 +150,26 @@ class Power extends Common
$params
[
'role_id'
]
=
$ret
[
0
][
'id'
];
}
}
$this
->
assign
(
'data'
,
$data
);
// 菜单列表
$power
=
AdminPowerService
::
RolePowerEditData
(
$params
);
$this
->
assign
(
'common_is_enable_list'
,
lang
(
'common_is_enable_list'
));
$this
->
assign
(
'power'
,
$power
);
// 角色编辑页面钩子
$hook_name
=
'plugins_view_admin_power_role_save'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
,
'data'
=>
&
$data
,
'params'
=>
&
$params
,
]));
// 数据
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
();
}
...
...
application/admin/controller/User.php
浏览文件 @
86760a49
...
...
@@ -152,11 +152,12 @@ class User extends Common
}
// 用户编辑页面钩子
$this
->
assign
(
'plugins_view_admin_user_save_data'
,
Hook
::
listen
(
'plugins_view_admin_user_save'
,
$hook_name
=
'plugins_view_admin_user_save'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
'plugins_view_admin_user_save'
,
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'user_id'
=>
$params
[
'id'
]
,
'user_id'
=>
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
,
'data'
=>
&
$data
,
'params'
=>
&
$params
,
]));
...
...
application/admin/view/default/admin/save_info.html
浏览文件 @
86760a49
...
...
@@ -39,6 +39,27 @@
</div>
{{/if}}
{{include file="lib/gender" /}}
<!-- 插件扩展数据 start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_admin_admin_save
</span>
</div>
{{/if}}
{{if !empty($plugins_view_admin_admin_save_data) and is_array($plugins_view_admin_admin_save_data)}}
<div
class=
"am-alert am-alert-secondary"
>
<label
class=
"am-text-sm am-text-warning"
>
该区域为插件扩展数据,请按照插件文档填写相应的值
</label>
<div>
{{foreach $plugins_view_admin_admin_save_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
</div>
</div>
{{/if}}
<!-- 插件扩展数据 end -->
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
['
id
'])}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
...
...
application/admin/view/default/article/save_info.html
浏览文件 @
86760a49
...
...
@@ -50,9 +50,29 @@
</div>
<div
class=
"am-form-group"
>
<label>
内容
</label>
<textarea
class=
"am-radius am-validate"
name=
"content"
rows=
"5"
minlength=
"10"
maxlength=
"105000"
{{
if
!
IsMobile
()}}
id=
"editor-tag"
data-url=
"{{:MyUrl('api/ueditor/index', ['path_type'=>'article'])}}"
placeholder=
"内容
长度最少 10~105000 个字符"
{{
else
/}}
placeholder=
"内容长度最少 10~105000 个字符更多编辑功能请使用电脑访问"
{{/
if
}}
data-validation-message=
"内容长度最少 10~105000 个字符
"
required
>
{{if !empty($data)}}{{$data.content}}{{/if}}
</textarea>
<textarea
class=
"am-radius am-validate"
name=
"content"
rows=
"5"
minlength=
"10"
maxlength=
"105000"
{{
if
!
IsMobile
()}}
id=
"editor-tag"
data-url=
"{{:MyUrl('api/ueditor/index', ['path_type'=>'article'])}}"
placeholder=
"内容
格式 10~105000 个字符之间"
{{
else
/}}
placeholder=
"内容格式 10~105000 个字符之间更多编辑功能请使用电脑访问"
{{/
if
}}
data-validation-message=
"内容格式 10~105000 个字符之间
"
required
>
{{if !empty($data)}}{{$data.content}}{{/if}}
</textarea>
</div>
<!-- 插件扩展数据 start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_admin_article_save
</span>
</div>
{{/if}}
{{if !empty($plugins_view_admin_article_save_data) and is_array($plugins_view_admin_article_save_data)}}
<div
class=
"am-alert am-alert-secondary"
>
<label
class=
"am-text-sm am-text-warning"
>
该区域为插件扩展数据,请按照插件文档填写相应的值
</label>
<div>
{{foreach $plugins_view_admin_article_save_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
</div>
</div>
{{/if}}
<!-- 插件扩展数据 end -->
<div
class=
"am-alert am-alert-secondary"
>
{{include file="lib/seo" /}}
</div>
...
...
application/admin/view/default/power/role_save_info.html
浏览文件 @
86760a49
...
...
@@ -56,6 +56,26 @@
<input
name=
"is_enable"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"50"
data-am-switch
{{
if
(
isset
($
data
['
is_enable
'])
and
$
data
['
is_enable
']
eq
1)
or
!
isset
($
data
['
is_enable
'])}}
checked=
"true"
{{/
if
}}
/>
</div>
<!-- 插件扩展数据 start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_admin_power_role_save
</span>
</div>
{{/if}}
{{if !empty($plugins_view_admin_power_role_save_data) and is_array($plugins_view_admin_power_role_save_data)}}
<div
class=
"am-alert am-alert-secondary"
>
<label
class=
"am-text-sm am-text-warning"
>
该区域为插件扩展数据,请按照插件文档填写相应的值
</label>
<div>
{{foreach $plugins_view_admin_power_role_save_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
</div>
</div>
{{/if}}
<!-- 插件扩展数据 end -->
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
)}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
...
...
application/tags.php
浏览文件 @
86760a49
...
...
@@ -34,55 +34,74 @@ return array (
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_service_goods_handle_end'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_service_goods_spec_base'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
),
'plugins_view_goods_detail_base_top'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_view_home_floor_top'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_service_user_login_success_record'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_service_goods_spec_extends_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_view_admin_user_save'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_service_user_save_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_service_goods_save_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_view_goods_detail_panel_price_top'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_view_home_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_view_search_goods_inside_bottom'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
'plugins_service_goods_spec_type'
=>
array
(
0
=>
'app\\plugins\\membershiplevel\\Hook'
,
0
=>
'app\\plugins\\membershiplevel
vip
\\Hook'
,
),
);
?>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录