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
9c14fd23
Commit
9c14fd23
authored
Mar 21, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解除绑定关系优化
parent
a22343ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
UserService.php
application/index/service/UserService.php
+7
-1
Users.php
application/model/Users.php
+8
-0
No files found.
application/index/service/UserService.php
View file @
9c14fd23
...
...
@@ -620,6 +620,12 @@ class UserService
// 客户bind_id不等于0才能解绑并记录日志
$user_info
=
$this
->
user
->
getUserById
(
$field
=
'bind_id'
,
$user_id
);
if
(
$user_info
[
'bind_id'
]
==
0
){
$band_count
=
$this
->
user
->
getUserCountByBandId
(
$field
=
'id'
,
$user_id
);
if
(
$band_count
==
1
){
$params_
[
'bind_id'
]
=
0
;
$this
->
user
->
updateUsers
(
$now_user_id
,
$params_
);
return
0
;
}
return
3
;
}
else
{
// 解绑操作记录
...
...
@@ -627,7 +633,7 @@ class UserService
}
$params_
[
'bind_id'
]
=
0
;
$
res
=
$
this
->
user
->
updateUsers
(
$user_id
,
$params_
);
$this
->
user
->
updateUsers
(
$user_id
,
$params_
);
return
0
;
}
...
...
application/model/Users.php
View file @
9c14fd23
...
...
@@ -740,6 +740,14 @@ class Users extends Model
->
find
();
}
public
function
getUserCountByBandId
(
$field
=
'*'
,
$bind_id
,
$where
=
''
)
{
return
$this
->
field
(
$field
)
->
where
(
'bind_id'
,
$bind_id
)
->
where
(
$where
)
->
count
();
}
public
function
getAgentByUserId
(
$field
,
$params
)
{
return
Db
::
name
(
$this
->
table
)
...
...
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