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
6ac71584
Commit
6ac71584
authored
Oct 12, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d60b871f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
UserService.php
application/index/service/UserService.php
+9
-5
Users.php
application/model/Users.php
+3
-0
No files found.
application/index/service/UserService.php
View file @
6ac71584
...
...
@@ -859,6 +859,7 @@ class UserService
*/
public
function
addUserBindType
(
$user_id
,
$bind_id
)
{
$redis_service
=
new
RedisCacheService
();
$user_bind_type
=
$this
->
user
->
getUserByWhereValue
(
'bind_type'
,
[
'id'
=>
$user_id
]);
if
((
$user_bind_type
==
1
)
or
(
$user_bind_type
==
2
)){
//当前客户设置过原盘 新增默认为重盘
...
...
@@ -867,6 +868,7 @@ class UserService
//当前客户未设原盘 新增默认为未设置
$this
->
user
->
updateUsers
(
$bind_id
,
[
'bind_type'
=>
0
]);
}
$redis_service
->
userCache
(
$bind_id
);
return
true
;
}
...
...
@@ -905,6 +907,8 @@ class UserService
return
2
;
//无解除关联权限权限
}
$this
->
removeUserBindType
(
$user_id
);
//原盘重盘重置
$now_user_info
=
$this
->
user
->
getUserById
(
$field
=
'bind_id'
,
$now_user_id
);
$params_
[
'bind_id'
]
=
0
;
...
...
@@ -924,7 +928,6 @@ class UserService
}
$this
->
user
->
updateUsers
(
$id
,
$params_
);
}
$this
->
removeUserBindType
(
$user_id
);
//原盘重盘重置
$redis_service
=
new
RedisCacheService
();
$redis_service
->
userCache
(
$user_id
);
$redis_service
->
userCache
(
$now_user_id
);
...
...
@@ -1061,20 +1064,21 @@ class UserService
*/
public
function
removeUserBindType
(
$user_id
)
{
$redis_service
=
new
RedisCacheService
();
$user_bind_type
=
$this
->
user
->
getUserByWhereValue
(
'bind_type'
,
[
'id'
=>
$user_id
]);
if
(
$user_bind_type
==
1
){
//当前用户是原盘的还原全部设置
$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
)
{
$this
->
user
->
updateUsers
(
$v
,
[
'bind_type'
=>
0
]);
$redis_service
->
userCache
(
$v
);
}
}
else
{
//
$this
->
user
->
updateUsers
(
$user_id
,
[
'bind_type'
=>
0
]);
$redis_service
->
userCache
(
$user_id
);
}
return
true
;
}
...
...
application/model/Users.php
View file @
6ac71584
...
...
@@ -1057,6 +1057,9 @@ class Users extends Model
/**
* 更新数据
* @param $id
* @param $params
* @return int|string
*/
public
function
updateUsers
(
$id
,
$params
)
{
...
...
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