Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
fe966544
Commit
fe966544
authored
Oct 09, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置原盘重盘
parent
c71c7027
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
Member.php
application/index/controller/Member.php
+20
-0
UserService.php
application/index/service/UserService.php
+25
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/Member.php
View file @
fe966544
...
...
@@ -772,4 +772,24 @@ class Member extends Basic{
return
$this
->
response
(
200
,
''
,
[
'list'
=>
$list
,
'total'
=>
$total
]);
}
/**
* 设置原盘重盘
* @return \think\Response
*/
public
function
setUserBindType
()
{
if
(
empty
(
$this
->
params
[
'user_id'
]))
{
return
$this
->
response
(
101
,
'user_id不能为空'
);
}
$s_index_user
=
new
UserService
();
$res
=
$s_index_user
->
setUserBindType
(
$this
->
params
[
'user_id'
]);
if
(
$res
)
{
return
$this
->
response
(
"200"
,
"绑定成功"
);
}
else
{
return
$this
->
response
(
"300"
,
'失败'
);
}
}
}
application/index/service/UserService.php
View file @
fe966544
...
...
@@ -1007,4 +1007,28 @@ class UserService
return
true
;
}
/**
* 设置原盘重盘
* @param $user_id
* @return bool
*/
public
function
setUserBindType
(
$user_id
)
{
// 根据userid把绑定关系查出来
$s_user_call
=
new
UserCallStintService
();
$user_list
=
$s_user_call
->
getUserBindList
(
$user_id
);
if
(
!
$user_list
or
(
count
(
$user_list
)
<
2
)){
return
false
;
}
foreach
(
$user_list
as
$k
=>
$v
)
{
if
(
$v
==
$user_id
){
// 将当前user_id设置为原盘 0:未设置 1:原盘 2:重盘
$this
->
user
->
updateUsers
(
$v
,
[
'bind_type'
=>
1
]);
}
else
{
// 其他设置为重盘
$this
->
user
->
updateUsers
(
$v
,
[
'bind_type'
=>
2
]);
}
}
return
true
;
}
}
\ No newline at end of file
application/route.php
View file @
fe966544
...
...
@@ -506,6 +506,8 @@ Route::group('index', [
'getUserBindHistory'
=>
[
'index/member/getUserBindHistory'
,
[
'method'
=>
'get|post'
]],
'lookUserLog'
=>
[
'index/member/lookUserLog'
,
[
'method'
=>
'get|post'
]],
//客户查看日志
'setUserBindType'
=>
[
'index/member/setUserBindType'
,
[
'method'
=>
'get|post'
]],
'saveActivity'
=>
[
'index/Activity/saveActivity'
,
[
'method'
=>
'POST|GET'
]],
//新增或修改活动
'getActivityList'
=>
[
'index/Activity/getActivityList'
,
[
'method'
=>
'POST|GET'
]],
//获取活动
'couponList'
=>
[
'index/Coupon/couponList'
,
[
'method'
=>
'GET'
]],
//获取活动
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment