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
fb150631
Commit
fb150631
authored
Apr 21, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
dd6a2278
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
71 deletions
+80
-71
User.php
application/api_broker/controller/User.php
+31
-26
Member.php
application/index/controller/Member.php
+30
-25
UserService.php
application/index/service/UserService.php
+19
-20
No files found.
application/api_broker/controller/User.php
View file @
fb150631
...
...
@@ -946,32 +946,37 @@ class User extends Basic
$s_index_user
=
new
UserService
();
//新增
$add_res
=
$s_index_user
->
addUserBind
(
$this
->
params
[
'user_id'
],
$this
->
params
[
'bind_id'
]);
switch
(
$add_res
)
{
case
1
:
return
$this
->
response
(
"300"
,
"参数不全"
);
break
;
case
2
:
return
$this
->
response
(
"300"
,
"当前客户已经存在绑定关系"
);
break
;
case
3
:
return
$this
->
response
(
"300"
,
"当前客户已经存在绑定关系"
);
break
;
case
4
:
return
$this
->
response
(
"300"
,
"绑定客户关系数超限"
);
break
;
case
5
:
return
$this
->
response
(
"300"
,
"绑定失败"
);
break
;
case
6
:
return
$this
->
response
(
"300"
,
"不得绑定自己"
);
break
;
case
0
:
return
$this
->
response
(
"200"
,
"绑定成功"
);
break
;
default
:
return
$this
->
response
(
"300"
,
"绑定失败"
);
}
if
(
$add_res
===
true
)
{
return
$this
->
response
(
"200"
,
"绑定成功"
);
}
else
{
return
$this
->
response
(
"300"
,
$add_res
);
}
// switch ($add_res) {
// case 1 :
// return $this->response("300", "参数不全");
// break;
// case 2 :
// return $this->response("300", "当前客户已经存在绑定关系");
// break;
// case 3 :
// return $this->response("300", "当前客户已经存在绑定关系");
// break;
// case 4 :
// return $this->response("300", "绑定客户关系数超限");
// break;
// case 5 :
// return $this->response("300", "绑定失败");
// break;
// case 6 :
// return $this->response("300", "不得绑定自己");
// break;
// case 0 :
// return $this->response("200", "绑定成功");
// break;
// default :
// return $this->response("300", "绑定失败");
//
// }
}
...
...
application/index/controller/Member.php
View file @
fb150631
...
...
@@ -591,32 +591,37 @@ class Member extends Basic{
$s_index_user
=
new
UserService
();
//新增
$add_res
=
$s_index_user
->
addUserBind
(
$this
->
params
[
'user_id'
],
$this
->
params
[
'bind_id'
]);
switch
(
$add_res
)
{
case
1
:
return
$this
->
response
(
"300"
,
"参数不全"
);
break
;
case
2
:
return
$this
->
response
(
"300"
,
"当前客户已经存在绑定关系"
);
break
;
case
3
:
return
$this
->
response
(
"300"
,
"当前客户已经存在绑定关系"
);
break
;
case
4
:
return
$this
->
response
(
"300"
,
"绑定客户关系数超限"
);
break
;
case
5
:
return
$this
->
response
(
"300"
,
"绑定失败"
);
break
;
case
6
:
return
$this
->
response
(
"300"
,
"不得绑定自己"
);
break
;
case
0
:
return
$this
->
response
(
"200"
,
"绑定成功"
);
break
;
default
:
return
$this
->
response
(
"300"
,
"绑定失败"
);
if
(
$add_res
===
true
)
{
return
$this
->
response
(
"200"
,
"绑定成功"
);
}
else
{
return
$this
->
response
(
"300"
,
$add_res
);
}
// switch ($add_res) {
// case 1 :
// return $this->response("300", "参数不全");
// break;
// case 2 :
// return $this->response("300", "当前客户已经存在绑定关系");
// break;
// case 3 :
// return $this->response("300", "当前客户已经存在绑定关系");
// break;
// case 4 :
// return $this->response("300", "绑定客户关系数超限");
// break;
// case 5 :
// return $this->response("300", "绑定失败");
// break;
// case 6 :
// return $this->response("300", "不得绑定自己");
// break;
// case 0 :
// return $this->response("200", "绑定成功");
// break;
// default :
// return $this->response("300", "绑定失败");
//
// }
}
...
...
application/index/service/UserService.php
View file @
fb150631
...
...
@@ -615,11 +615,11 @@ class UserService
*/
public
function
addUserBind
(
$user_id
,
$bind_id
){
if
(
!
$user_id
or
!
$bind_id
){
return
1
;
return
'参数不全'
;
}
if
(
$user_id
==
$bind_id
){
return
6
;
return
'不得绑定自己'
;
}
// 先查当前用户bind_id是否等于0 user_id 当前详情页客户
...
...
@@ -628,33 +628,32 @@ class UserService
//排除主账号
$user_bind_count
=
$this
->
user
->
getBindCount
(
$bind_id
);
if
(
$user_bind_count
>
0
){
return
2
;
//当前客户已经存在绑定关系
}
$user_id
=
$bind_id
;
$bind_id_
=
$user_info
[
'bind_id'
];
}
else
{
$user_bind
=
$this
->
userBindInfo
(
$user_id
);
if
(
count
(
$user_bind
)
>
0
){
return
3
;
//存在绑定关系
return
'当前客户已经存在绑定关系'
;
//当前客户已经存在绑定关系
}
$params_user_id
=
$bind_id
;
$params_bind_id
=
$user_info
[
'bind_id'
];
}
else
{
//=o 主账号
$b_user_info
=
$this
->
user
->
getUserById
(
$field
=
'bind_id'
,
$bind_id
);
if
(
$b_user_info
[
'bind_id'
]
==
0
){
$bind_id_
=
$bind_id
;
}
else
{
$bind_id_
=
$b_user_info
[
'bind_id'
];
//排除主账号
$user_bind_count
=
$this
->
user
->
getBindCount
(
$bind_id
);
if
(
$user_bind_count
>
0
){
return
'当前客户已经存在绑定关系'
;
//当前客户已经存在绑定关系
}
}
$params_user_id
=
$bind_id
;
$params_bind_id
=
$user_id
;
}
$bind_count
=
$this
->
userBindInfo
(
$
bind_id_
);
$bind_count
=
$this
->
userBindInfo
(
$
params_bind_id
);
if
(
count
(
$bind_count
)
>
3
){
return
4
;
return
'绑定客户关系数超限'
;
}
$params_
[
'bind_id'
]
=
$
bind_id_
;
$res
=
$this
->
user
->
updateUsers
(
$user_id
,
$params_
);
$params_
[
'bind_id'
]
=
$
params_bind_id
;
$res
=
$this
->
user
->
updateUsers
(
$
params_
user_id
,
$params_
);
if
(
$res
==
1
){
return
0
;
return
true
;
}
else
{
return
5
;
return
'绑定失败'
;
}
}
...
...
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