Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
9fd62d45
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
9fd62d45
编写于
2月 14, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用钩子名称优化
上级
01103c7e
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
24 addition
and
24 deletion
+24
-24
application/index/controller/Common.php
application/index/controller/Common.php
+1
-1
application/index/controller/User.php
application/index/controller/User.php
+1
-1
application/index/view/default/public/header.html
application/index/view/default/public/header.html
+3
-3
application/index/view/default/user/index.html
application/index/view/default/user/index.html
+3
-3
application/plugins/commontopmaxpicture/config.json
application/plugins/commontopmaxpicture/config.json
+1
-1
application/plugins/commontopnotice/config.json
application/plugins/commontopnotice/config.json
+1
-1
application/plugins/usercentertopnotice/config.json
application/plugins/usercentertopnotice/config.json
+1
-1
application/plugins/userlogingiveintegral/Hook.php
application/plugins/userlogingiveintegral/Hook.php
+7
-7
application/plugins/userlogingiveintegral/config.json
application/plugins/userlogingiveintegral/config.json
+1
-1
application/service/UserService.php
application/service/UserService.php
+2
-2
application/tags.php
application/tags.php
+3
-3
未找到文件。
application/index/controller/Common.php
浏览文件 @
9fd62d45
...
...
@@ -81,7 +81,7 @@ class Common extends Controller
private
function
CommonPluginsInit
()
{
// 公共顶部钩子
$this
->
assign
(
'plugins_
common_top_data'
,
Hook
::
listen
(
'plugins_common_top'
,
[
'hook_name'
=>
'plugins_common_top'
,
'is_control'
=>
false
]));
$this
->
assign
(
'plugins_
view_common_top_data'
,
Hook
::
listen
(
'plugins_view_common_top'
,
[
'hook_name'
=>
'plugins_view_common_top'
,
'is_control'
=>
false
,
'user'
=>
$this
->
user
]));
}
/**
...
...
application/index/controller/User.php
浏览文件 @
9fd62d45
...
...
@@ -137,7 +137,7 @@ class User extends Common
$this
->
assign
(
'goods_browse_list'
,
$data
[
'data'
]);
// 用户中心顶部钩子
$this
->
assign
(
'plugins_
user_center_top_data'
,
Hook
::
listen
(
'plugins_user_center_top'
,
[
'hook_name'
=>
'plugins_user_center_top'
,
'is_control'
=>
false
]));
$this
->
assign
(
'plugins_
view_user_center_top_data'
,
Hook
::
listen
(
'plugins_view_user_center_top'
,
[
'hook_name'
=>
'plugins_view_user_center_top'
,
'is_control'
=>
false
,
'user'
=>
$this
->
user
]));
return
$this
->
fetch
();
}
...
...
application/index/view/default/public/header.html
浏览文件 @
9fd62d45
...
...
@@ -42,11 +42,11 @@
<!-- 公共顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_header) or $is_header eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_common_top
</span>
<span>
plugins_
view_
common_top
</span>
</div>
{{/if}}
{{if !empty($plugins_
common_top_data) and is_array($plugins
_common_top_data) and (!isset($is_header) or $is_header eq 1)}}
{{foreach $plugins_common_top_data as $hook}}
{{if !empty($plugins_
view_common_top_data) and is_array($plugins_view
_common_top_data) and (!isset($is_header) or $is_header eq 1)}}
{{foreach $plugins_
view_
common_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
...
...
application/index/view/default/user/index.html
浏览文件 @
9fd62d45
...
...
@@ -29,11 +29,11 @@
<!-- 用户中心顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_user_center_top
</span>
<span>
plugins_
view_
user_center_top
</span>
</div>
{{/if}}
{{if !empty($plugins_
user_center_top_data) and is_array($plugins
_user_center_top_data)}}
{{foreach $plugins_user_center_top_data as $hook}}
{{if !empty($plugins_
view_user_center_top_data) and is_array($plugins_view
_user_center_top_data)}}
{{foreach $plugins_
view_
user_center_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
...
...
application/plugins/commontopmaxpicture/config.json
浏览文件 @
9fd62d45
...
...
@@ -17,7 +17,7 @@
"is_home"
:
false
},
"hook"
:{
"plugins_common_top"
:[
"plugins_
view_
common_top"
:[
"app
\\
plugins
\\
commontopmaxpicture
\\
Hook"
]
}
...
...
application/plugins/commontopnotice/config.json
浏览文件 @
9fd62d45
...
...
@@ -17,7 +17,7 @@
"is_home"
:
false
},
"hook"
:{
"plugins_common_top"
:[
"plugins_
view_
common_top"
:[
"app
\\
plugins
\\
commontopnotice
\\
Hook"
]
}
...
...
application/plugins/usercentertopnotice/config.json
浏览文件 @
9fd62d45
...
...
@@ -17,7 +17,7 @@
"is_home"
:
false
},
"hook"
:{
"plugins_user_center_top"
:[
"plugins_
view_
user_center_top"
:[
"app
\\
plugins
\\
usercentertopnotice
\\
Hook"
]
}
...
...
application/plugins/userlogingiveintegral/Hook.php
浏览文件 @
9fd62d45
...
...
@@ -37,12 +37,12 @@ class Hook
// 是否控制器钩子
if
(
isset
(
$params
[
'is_control'
])
&&
$params
[
'is_control'
]
===
true
&&
!
empty
(
$params
[
'hook_name'
]))
{
if
(
!
empty
(
$params
[
'user'
]))
if
(
!
empty
(
$params
[
'user
_id
'
]))
{
switch
(
$params
[
'hook_name'
])
{
// 用户登录成功后赠送积分
case
'plugins_user_login_end'
:
case
'plugins_
control_
user_login_end'
:
$ret
=
$this
->
LoginGiveIntegral
(
$params
);
break
;
...
...
@@ -96,7 +96,7 @@ class Hook
if
(
isset
(
$ret
[
'data'
][
'is_day_once'
])
&&
$ret
[
'data'
][
'is_day_once'
]
==
1
)
{
$where
=
[
[
'user_id'
,
'='
,
$params
[
'user
'
][
'
id'
]],
[
'user_id'
,
'='
,
$params
[
'user
_
id'
]],
[
'add_time'
,
'>='
,
strtotime
(
date
(
'Y-m-d 00:00:00'
))],
[
'type'
,
'='
,
1
],
[
'msg'
,
'='
,
'登录赠送积分'
],
...
...
@@ -113,17 +113,17 @@ class Hook
if
(
!
empty
(
$give_integral
))
{
// 用户积分添加
$user_integral
=
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$params
[
'user
'
][
'
id'
]])
->
value
(
'integral'
);
if
(
!
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$params
[
'user
'
][
'
id'
]])
->
setInc
(
'integral'
,
$give_integral
))
$user_integral
=
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$params
[
'user
_
id'
]])
->
value
(
'integral'
);
if
(
!
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$params
[
'user
_
id'
]])
->
setInc
(
'integral'
,
$give_integral
))
{
return
DataReturn
(
'登录赠送积分失败'
,
-
10
);
}
// 积分日志
IntegralService
::
UserIntegralLogAdd
(
$params
[
'user
'
][
'
id'
],
$user_integral
,
$user_integral
+
$give_integral
,
'登录赠送积分'
,
1
);
IntegralService
::
UserIntegralLogAdd
(
$params
[
'user
_
id'
],
$user_integral
,
$user_integral
+
$give_integral
,
'登录赠送积分'
,
1
);
// 更新用户登录缓存数据
UserService
::
UserLoginRecord
(
$params
[
'user
'
][
'
id'
]);
UserService
::
UserLoginRecord
(
$params
[
'user
_
id'
]);
return
DataReturn
(
'登录赠送积分成功'
,
0
);
}
else
{
...
...
application/plugins/userlogingiveintegral/config.json
浏览文件 @
9fd62d45
...
...
@@ -17,7 +17,7 @@
"is_home"
:
false
},
"hook"
:{
"plugins_user_login_end"
:[
"plugins_
control_
user_login_end"
:[
"app
\\
plugins
\\
userlogingiveintegral
\\
Hook"
]
}
...
...
application/service/UserService.php
浏览文件 @
9fd62d45
...
...
@@ -812,7 +812,7 @@ class UserService
}
// 用户登录前钩子
$ret
=
Hook
::
listen
(
'plugins_
user_login_begin'
,
[
'hook_name'
=>
'plugins_user_login_begin'
,
'is_control'
=>
true
,
'params'
=>
$params
,
'user'
=>
$user
]);
$ret
=
Hook
::
listen
(
'plugins_
control_user_login_begin'
,
[
'hook_name'
=>
'plugins_control_user_login_begin'
,
'is_control'
=>
true
,
'params'
=>
$params
,
'user_id'
=>
$user
[
'id'
]
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
...
...
@@ -831,7 +831,7 @@ class UserService
if
(
self
::
UserLoginRecord
(
$user
[
'id'
]))
{
// 用户登录后钩子
$ret
=
Hook
::
listen
(
'plugins_
user_login_end'
,
[
'hook_name'
=>
'plugins_user_login_end'
,
'is_control'
=>
true
,
'params'
=>
$params
,
'user'
=>
$user
]);
$ret
=
Hook
::
listen
(
'plugins_
control_user_login_end'
,
[
'hook_name'
=>
'plugins_control_user_login_end'
,
'is_control'
=>
true
,
'params'
=>
$params
,
'user_id'
=>
$user
[
'id'
]
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
...
...
application/tags.php
浏览文件 @
9fd62d45
...
...
@@ -32,16 +32,16 @@ return array (
'log_write'
=>
array
(
),
'plugins_common_top'
=>
'plugins_
view_
common_top'
=>
array
(
0
=>
'app\\plugins\\commontopmaxpicture\\Hook'
,
1
=>
'app\\plugins\\commontopnotice\\Hook'
,
),
'plugins_user_center_top'
=>
'plugins_
view_
user_center_top'
=>
array
(
0
=>
'app\\plugins\\usercentertopnotice\\Hook'
,
),
'plugins_user_login_end'
=>
'plugins_
control_
user_login_end'
=>
array
(
0
=>
'app\\plugins\\userlogingiveintegral\\Hook'
,
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录