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
1ea0a10e
Commit
1ea0a10e
authored
Jun 15, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
36b333d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
WxSdk.php
application/api/controller/WxSdk.php
+1
-1
RegisterService.php
application/api/service/RegisterService.php
+12
-4
UWxInfo.php
application/model/UWxInfo.php
+0
-3
No files found.
application/api/controller/WxSdk.php
View file @
1ea0a10e
...
@@ -72,7 +72,7 @@ class WxSdk extends Basic
...
@@ -72,7 +72,7 @@ class WxSdk extends Basic
}
}
/**
/**
* 绑定用户 记录最后一次绑定
* 绑定用户 记录最后一次绑定
废弃
* @return \think\Response
* @return \think\Response
*/
*/
public
function
bindUserId
()
public
function
bindUserId
()
...
...
application/api/service/RegisterService.php
View file @
1ea0a10e
...
@@ -42,6 +42,7 @@ class RegisterService
...
@@ -42,6 +42,7 @@ class RegisterService
$fields
=
"id,user_nick,user_pic,sex,agent_id,referrer_id,referrer_source,user_phone,status"
;
$fields
=
"id,user_nick,user_pic,sex,agent_id,referrer_id,referrer_source,user_phone,status"
;
$user_info
=
$this
->
userModel
->
getUserByWhere
(
$conditions
,
$fields
);
$user_info
=
$this
->
userModel
->
getUserByWhere
(
$conditions
,
$fields
);
$buyer_id
=
0
;
$user_nick
=
""
;
$user_nick
=
""
;
$sex
=
0
;
$sex
=
0
;
$id
=
0
;
$id
=
0
;
...
@@ -78,6 +79,7 @@ class RegisterService
...
@@ -78,6 +79,7 @@ class RegisterService
$field
=
"id,wx_union_id,buyer_nick,buyer_img,sex"
;
$field
=
"id,wx_union_id,buyer_nick,buyer_img,sex"
;
$wxInfoArr
=
$this
->
wxInfoModel
->
getWxInfoByOpenId
(
$wx_union_id
,
$field
);
$wxInfoArr
=
$this
->
wxInfoModel
->
getWxInfoByOpenId
(
$wx_union_id
,
$field
);
if
(
count
(
$wxInfoArr
)
>
0
)
{
if
(
count
(
$wxInfoArr
)
>
0
)
{
$buyer_id
=
$wxInfoArr
[
0
][
"id"
];
$user_nick
=
!
empty
(
$user_nick
)
?
$user_nick
:
$wxInfoArr
[
0
][
"buyer_nick"
];
$user_nick
=
!
empty
(
$user_nick
)
?
$user_nick
:
$wxInfoArr
[
0
][
"buyer_nick"
];
$sex
=
!
empty
(
$sex
)
?
$sex
:
$wxInfoArr
[
0
][
"sex"
];
$sex
=
!
empty
(
$sex
)
?
$sex
:
$wxInfoArr
[
0
][
"sex"
];
$other_pic
=
$wxInfoArr
[
0
][
"buyer_img"
];
$other_pic
=
$wxInfoArr
[
0
][
"buyer_img"
];
...
@@ -90,17 +92,17 @@ class RegisterService
...
@@ -90,17 +92,17 @@ class RegisterService
if
(
$agent_id
==
0
)
{
if
(
$agent_id
==
0
)
{
$agent_id
=
$this
->
inviteRelationship
(
$referrer_id
,
$referrer_source
);
$agent_id
=
$this
->
inviteRelationship
(
$referrer_id
,
$referrer_source
);
}
}
$userArr
=
$this
->
userBin
(
$user_nick
,
$sex
,
$id
,
$status
,
$agent_id
,
$phone
,
$referrer_id
,
$referrer_source
,
$last_login_ip
,
$other_pic
);
$userArr
=
$this
->
userBin
(
$user_nick
,
$sex
,
$id
,
$
buyer_id
,
$
status
,
$agent_id
,
$phone
,
$referrer_id
,
$referrer_source
,
$last_login_ip
,
$other_pic
);
//保存数据
//保存数据
$id
=
$this
->
userModel
->
saveUser
(
$userArr
);
$id
=
$this
->
userModel
->
saveUser
(
$userArr
);
//绑定微信
/*
//绑定微信
if ($wxInfoArr) {
if ($wxInfoArr) {
$params["user_id"] = $id;
$params["user_id"] = $id;
$params["id"] = $wxInfoArr[0]["id"];
$params["id"] = $wxInfoArr[0]["id"];
$this->wxInfoModel->updateWxInfo($params);
$this->wxInfoModel->updateWxInfo($params);
}
}
*/
$jwt_data
[
'id'
]
=
$id
;
$jwt_data
[
'id'
]
=
$id
;
$jwt_data
[
'userNick'
]
=
$user_nick
;
$jwt_data
[
'userNick'
]
=
$user_nick
;
...
@@ -118,6 +120,7 @@ class RegisterService
...
@@ -118,6 +120,7 @@ class RegisterService
* @param $user_nick
* @param $user_nick
* @param $sex
* @param $sex
* @param $id
* @param $id
* @param $buyer_id
* @param $status
* @param $status
* @param $agent_id
* @param $agent_id
* @param $phone
* @param $phone
...
@@ -127,14 +130,17 @@ class RegisterService
...
@@ -127,14 +130,17 @@ class RegisterService
* @param $other_pic
* @param $other_pic
* @return mixed
* @return mixed
*/
*/
public
function
userBin
(
$user_nick
,
$sex
,
$id
,
$status
,
$agent_id
,
$phone
,
$referrer_id
,
$referrer_source
,
$last_login_ip
,
$other_pic
)
public
function
userBin
(
$user_nick
,
$sex
,
$id
,
$
buyer_id
,
$
status
,
$agent_id
,
$phone
,
$referrer_id
,
$referrer_source
,
$last_login_ip
,
$other_pic
)
{
{
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
$userParams
[
"id"
]
=
$id
;
$userParams
[
"id"
]
=
$id
;
}
else
{
}
else
{
$userParams
[
"registration_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$userParams
[
"registration_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
if
(
$referrer_id
==
0
)
$userParams
[
"first_login_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
//记录第一次登录时间排除邀请注册
}
}
$userParams
[
"buyer_id"
]
=
$buyer_id
;
$userParams
[
"user_phone"
]
=
$phone
;
$userParams
[
"user_phone"
]
=
$phone
;
$userParams
[
"user_nick"
]
=
$user_nick
;
$userParams
[
"user_nick"
]
=
$user_nick
;
$userParams
[
"sex"
]
=
$sex
;
$userParams
[
"sex"
]
=
$sex
;
...
@@ -150,6 +156,8 @@ class RegisterService
...
@@ -150,6 +156,8 @@ class RegisterService
$userParams
[
"last_login_ip"
]
=
$last_login_ip
;
$userParams
[
"last_login_ip"
]
=
$last_login_ip
;
$userParams
[
"last_login_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$userParams
[
"last_login_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
}
}
return
$userParams
;
return
$userParams
;
}
}
...
...
application/model/UWxInfo.php
View file @
1ea0a10e
...
@@ -90,9 +90,6 @@ class UWxInfo extends Model
...
@@ -90,9 +90,6 @@ class UWxInfo extends Model
}
else
{
}
else
{
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
}
}
if
(
isset
(
$params
[
"user_id"
]))
{
$arr
[
"user_id"
]
=
$params
[
"user_id"
];
}
if
(
isset
(
$params
[
"wx_open_id"
]))
{
if
(
isset
(
$params
[
"wx_open_id"
]))
{
$arr
[
"wx_open_id"
]
=
$params
[
"wx_open_id"
];
$arr
[
"wx_open_id"
]
=
$params
[
"wx_open_id"
];
}
}
...
...
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