Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_welfare_api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cce9face
authored
Oct 09, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加字段告诉前端是否已经绑定公众号
parent
580b1303
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
app/Http/Controllers/ExchangeSettingsController.php
app/Services/ExchangeSettingService.php
app/Http/Controllers/ExchangeSettingsController.php
View file @
cce9face
...
...
@@ -59,6 +59,9 @@ class ExchangeSettingsController extends Controller
$info
=
$this
->
service
->
getWeixinExchangeInfo
(
$userId
);
$exchangeSettings
[
'weixin_exchange_info'
]
=
$info
;
//获取是否绑定了公众号
$exchangeSettings
[
'official_account_bind'
]
=
$this
->
service
->
getOfficialAccountBind
(
$userId
)
?
1
:
0
;
return
$this
->
Export
(
0
,
'ok'
,
$exchangeSettings
);
}
}
\ No newline at end of file
app/Services/ExchangeSettingService.php
View file @
cce9face
...
...
@@ -4,6 +4,8 @@
namespace
App\Services
;
use
Common\Model\RedisModel
;
class
ExchangeSettingService
{
public
function
getExchangeSettingList
(
$map
=
[])
...
...
@@ -20,13 +22,13 @@ class ExchangeSettingService
{
//先去获取用户是否有正卡着好友助力的兑换记录
$map
=
[
'user_id'
=>
$userId
,
'type'
=>
2
,
'user_id'
=>
$userId
,
'type'
=>
2
,
'page_size'
=>
1
,
];
$userExchangeService
=
new
UserExchangeService
();
$userExchange
=
array_get
(
$userExchangeService
->
getUserExchangeList
(
$map
),
'data'
,
[]);
$userExchange
=
array_get
(
$userExchange
,
0
);
$userExchange
=
array_get
(
$userExchange
,
0
);
//如果最后一条记录是未审核就代表这个需要好友助力
$info
=
[];
$info
[
'exchanging'
]
=
$info
[
'assist_count'
]
=
$info
[
'exchange_id'
]
=
0
;
...
...
@@ -42,4 +44,16 @@ class ExchangeSettingService
return
$info
;
}
//获取公众号绑定信息
public
function
getOfficialAccountBind
(
$userId
)
{
$redis
=
new
RedisModel
();
//user_oauth 绑定公众号类型为2
$oauthOfficialAccountType
=
2
;
$keyName
=
$userId
.
'-'
.
$oauthOfficialAccountType
;
$userOauth
=
json_decode
(
$redis
->
hget
(
'ic_user_oauth'
,
$keyName
),
true
);
return
$userOauth
;
}
}
\ No newline at end of file
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