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
3c7c453f
Commit
3c7c453f
authored
Jun 15, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定微信
parent
ac0557d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
WxSdk.php
application/api/controller/WxSdk.php
+7
-2
UWxInfo.php
application/model/UWxInfo.php
+1
-1
No files found.
application/api/controller/WxSdk.php
View file @
3c7c453f
...
@@ -12,17 +12,20 @@ namespace app\api\controller;
...
@@ -12,17 +12,20 @@ namespace app\api\controller;
*/
*/
use
app\api\extend\Basic
;
use
app\api\extend\Basic
;
use
app\model\Users
;
use
app\model\UWxInfo
;
use
app\model\UWxInfo
;
use
think\Exception
;
use
think\Exception
;
class
WxSdk
extends
Basic
class
WxSdk
extends
Basic
{
{
private
$wxInfoModel
;
private
$wxInfoModel
;
private
$userModel
public
function
__construct
(
$request
=
null
)
public
function
__construct
(
$request
=
null
)
{
{
parent
::
__construct
(
$request
);
parent
::
__construct
(
$request
);
$this
->
wxInfoModel
=
new
UWxInfo
();
$this
->
wxInfoModel
=
new
UWxInfo
();
$this
->
userModel
=
new
Users
();
}
}
/**
/**
...
@@ -61,10 +64,12 @@ class WxSdk extends Basic
...
@@ -61,10 +64,12 @@ class WxSdk extends Basic
}
catch
(
Exception
$exception
)
{
}
catch
(
Exception
$exception
)
{
return
$this
->
response
(
"101"
,
"request error:"
.
$exception
);
return
$this
->
response
(
"101"
,
"request error:"
.
$exception
);
}
}
$conditions
[
"buyer_id"
]
=
$id
;
$fields
=
"id"
;
$user_info
=
$this
->
userModel
->
getUserByWhere
(
$conditions
,
$fields
);
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[
"user_id"
=>
$
wxInfoObj
[
0
][
"user_
id"
]
]);
return
$this
->
response
(
"200"
,
"request success"
,
[
"user_id"
=>
$
user_info
[
0
][
"
id"
]
]);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
"request exception"
);
return
$this
->
response
(
"101"
,
"request exception"
);
}
}
...
...
application/model/UWxInfo.php
View file @
3c7c453f
...
@@ -67,7 +67,7 @@ class UWxInfo extends Model
...
@@ -67,7 +67,7 @@ class UWxInfo extends Model
* @param string $field
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getWxInfoByOpenId
(
string
$open_id
,
string
$field
=
"id
,user_id
"
)
public
function
getWxInfoByOpenId
(
string
$open_id
,
string
$field
=
"id"
)
{
{
$where_
[
"wx_union_id"
]
=
$open_id
;
$where_
[
"wx_union_id"
]
=
$open_id
;
$where_
[
"is_del"
]
=
0
;
$where_
[
"is_del"
]
=
0
;
...
...
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