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
f852e444
Commit
f852e444
authored
Jun 26, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
aed133bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
6 deletions
+46
-6
Register.php
application/api/controller/Register.php
+30
-5
RegisterService.php
application/api/service/RegisterService.php
+13
-1
RegisterValidate.php
application/api/validate/RegisterValidate.php
+2
-0
route.php
application/route.php
+1
-0
No files found.
application/api/controller/Register.php
View file @
f852e444
...
...
@@ -103,11 +103,11 @@ class Register extends Basic
*/
public
function
removeBinding
()
{
$params
=
$this
->
params
;
/* $params = array(
"buyer_id" => 5,
"user_id" => 25983,
);*/
$params
=
$this
->
params
;
/* $params = array(
"buyer_id" => 5,
"user_id" => 25983,
);*/
$checkResult
=
$this
->
validate
(
$params
,
"RegisterValidate.removeBind"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
...
...
@@ -120,4 +120,28 @@ class Register extends Basic
return
$this
->
response
(
"101"
,
"解绑失败"
);
}
}
/**
* 绑定微信
* @return \think\Response
*/
public
function
bindingWx
()
{
$params
=
$this
->
params
;
/* $params = array(
"wx_union_id" => "asdfasfasdf",
"phone" => 25983,
);*/
$checkResult
=
$this
->
validate
(
$params
,
"RegisterValidate.bind"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$msg
=
$this
->
service_
->
binding
(
$params
[
"wx_union_id"
],
$params
[
"phone"
]);
if
(
$msg
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$msg
[
"data"
]);
}
else
{
return
$this
->
response
(
"200"
,
"绑定成功"
,
$msg
[
"data"
]);
}
}
}
\ No newline at end of file
application/api/service/RegisterService.php
View file @
f852e444
...
...
@@ -132,6 +132,18 @@ class RegisterService
return
$this
->
userModel
->
unbundlingWx
(
$params
);
}
/**
* 绑定微信
* @param $wx_union_id
* @param $phone
* @return array
*/
public
function
binding
(
$wx_union_id
,
$phone
)
{
return
$this
->
userRegister
(
$phone
,
0
,
0
,
$wx_union_id
,
0
);
}
/**
* 组装bin
* @param $user_nick
...
...
@@ -182,7 +194,7 @@ class RegisterService
$userParams
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
//分享出去激活的不记录登录时间和ip
if
(
$referrer_id
==
0
)
{
if
(
$referrer_id
==
0
&&
$last_login_ip
!=
0
)
{
$userParams
[
"last_login_ip"
]
=
$last_login_ip
;
$userParams
[
"last_login_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
}
...
...
application/api/validate/RegisterValidate.php
View file @
f852e444
...
...
@@ -39,5 +39,6 @@ class RegisterValidate extends Validate
'verify'
=>
[
'phone'
,
'device_id'
],
'register'
=>
[
'phone'
,
'device_id'
,
'code'
],
'removeBind'
=>
[
'user_id'
,
'buyer_id'
],
'bind'
=>
[
'user_id'
,
'wx_union_id'
],
];
}
\ No newline at end of file
application/route.php
View file @
f852e444
...
...
@@ -317,6 +317,7 @@ Route::group('api', [
'sendCode'
=>
[
'api/Register/registerSendCode'
,
[
'method'
=>
'POST'
]
],
'userVerify'
=>
[
'api/Register/registerVerify'
,
[
'method'
=>
'POST'
]
],
'removeBind'
=>
[
'api/Register/removeBinding'
,
[
'method'
=>
'POST|GET'
]
],
'bindingWx'
=>
[
'api/Register/bindingWx'
,
[
'method'
=>
'POST'
]
],
//绑定微信
]);
...
...
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