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
5d48e65f
Commit
5d48e65f
authored
Nov 15, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
9027be65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
ShareShop.php
application/index/controller/ShareShop.php
+17
-6
No files found.
application/index/controller/ShareShop.php
View file @
5d48e65f
...
...
@@ -41,16 +41,27 @@ class ShareShop extends Basic
if
(
!
$code
)
{
$this
->
_wxApi
->
getWxCodesnSapiBase
(
$this
->
url
.
'?'
.
http_build_query
(
$params
));
}
else
{
$data
=
$this
->
_wxApi
->
getUserInfoByAccessToken
(
$code
);
$userInfo
=
$this
->
_wxApi
->
getUserInfoByAccessToken
(
$code
);
$wx_union_id
=
$userInfo
[
'wx_union_id'
]
?
$userInfo
[
'wx_union_id'
]
:
$userInfo
[
'wx_open_id'
];
if
(
!
$userInfo
[
'wx_union_id'
]){
$userInfo
[
'wx_union_id'
]
=
$userInfo
[
'wx_open_id'
];
}
$user_service
=
new
UserService
();
$is_user
=
$user_service
->
isUserByweiXin
(
$data
[
'wx_union_id'
]);
$is_user
=
$user_service
->
isUserByweiXin
(
$wx_union_id
);
$userInfo
[
"source"
]
=
0
;
$data
[
"source"
]
=
0
;
$this
->
wxInfoModel
->
addWxInfo
(
$data
);
// 验证open_id是否已经存在,存在则更新
$wxInfoObj
=
$this
->
wxInfoModel
->
getWxInfoByOpenId
(
$wx_union_id
);
if
(
$wxInfoObj
&&
count
(
$wxInfoObj
)
>
0
)
{
$userInfo
[
"id"
]
=
$wxInfoObj
[
0
][
"id"
];
$id
=
$this
->
wxInfoModel
->
updateWxInfo
(
$userInfo
);
}
else
{
$id
=
$this
->
wxInfoModel
->
addWxInfo
(
$userInfo
);
}
$params
[
'is_user'
]
=
$is_user
;
$params
[
'wx_union_id'
]
=
$
data
[
'wx_union_id'
]
;
$params
[
'wx_union_id'
]
=
$
wx_union_id
;
$params
[
'device_id'
]
=
$this
->
createOrderNumber
();
}
}
...
...
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