Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_server_welfare
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
70a6f140
authored
Oct 10, 2019
by
叶明星
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
接入微信红包提现
parent
8682c4ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
2 deletions
.env
app/Http/Controllers/ExchangesTask.php
common
config/system.php
.env
View file @
70a6f140
...
...
@@ -32,6 +32,8 @@ SYSTEM_CODE=09
SYSTEM_NAME=IC业务助手福利中心服务
//laravels监听IP和端口
LARAVELS_LISTEN_IP=0.0.0.0
LARAVELS_LISTEN_PORT=61009
...
...
@@ -50,3 +52,5 @@ RobotUrl=https://oapi.dingtalk.com/robot/send?access_token=a7255513c160f20d65c0c
LARAVELS_TIMER = true
wechat_api_url=https://wechat.icsales.com
app/Http/Controllers/ExchangesTask.php
View file @
70a6f140
...
...
@@ -61,7 +61,33 @@ class ExchangesTask extends Task
//红包提现(后期需要对接微信平台)
public
function
Integrals
(){
//目前只改审核状态
//获取用户的unionid
$Redis
=
new
RedisModel
();
$UserInfo
=
json_decode
(
$Redis
->
hget
(
'ic_user'
,
$this
->
data
[
'user_id'
]),
true
);
if
(
!
$UserInfo
||
empty
(
$UserInfo
[
'union_id'
]))
throw
new
\Exception
(
'用户union_id获取失败#'
.
$this
->
data
[
'id'
]);
//获取用户的微信openid
$wechat
=
json_decode
(
$Redis
->
hget
(
'ic_user_oauth'
,
$UserInfo
[
'union_id'
]
.
'_2'
),
true
);
if
(
!
$wechat
||
empty
(
$wechat
[
'open_id'
]))
throw
new
\Exception
(
'用户open_id获取失败#'
.
$this
->
data
[
'id'
]);
//发放红包
$Url
=
config
(
'system.wechat_api_url'
)
.
'/payment/send/normal'
;
$map
=
[
'mch_billno'
=>
'integrals'
.
$this
->
data
[
'id'
],
're_openid'
=>
$wechat
[
'open_id'
],
'total_amount'
=>
$this
->
Exchange
[
'amount'
],
'wishing'
=>
'天下都是我的,而我的都是你的!'
,
'act_name'
=>
'红包提现'
,
'remark'
=>
'芯掌柜'
];
$data
=
ExcessEncryption
(
$map
,
config
(
'system.secretKey'
));
$result
=
json_decode
(
reportCurl
(
$Url
,
$data
,
true
),
true
);
if
(
!
$result
||
!
isset
(
$result
[
'errcode'
])
||
$result
[
'errcode'
]
!==
0
)
throw
new
\Exception
(
'红包提现失败#'
.
$this
->
data
[
'id'
]
.
json_encode
(
$result
));
return
true
;
}
...
...
common
@
8428774c
Subproject commit
6a492b76f3938205ed9d94cd12b81d66feea657d
Subproject commit
8428774c731bbcd89366d7d698daf57579f0b53b
config/system.php
View file @
70a6f140
...
...
@@ -6,4 +6,6 @@ return [
'SystemName'
=>
env
(
'SYSTEM_NAME'
,
'这家伙没设置系统'
),
//系统名称
"at"
=>
env
(
'AT'
),
'IC_AUTH_API'
=>
env
(
'IC_AUTH_API'
),
'secretKey'
=>
'J73K*j6t!%UR0jZ^pgcpn6LhFZafl7bk'
,
//32位的加密通讯秘钥
'wechat_api_url'
=>
env
(
'wechat_api_url'
)
];
\ 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