Commit 8afb2a55 by 叶明星

Merge branch 'ymx-接入微信现金红包-20191009'

parents f10326a1 febf2bef
Showing with 5 additions and 11 deletions
...@@ -64,24 +64,18 @@ class ExchangesTask extends Task ...@@ -64,24 +64,18 @@ class ExchangesTask extends Task
//获取用户的unionid //获取用户的unionid
$Redis = new RedisModel(); $Redis = new RedisModel();
$UserInfo = json_decode($Redis->hget('ic_user', $this->data['user_id']), true); $UserInfo = json_decode($Redis->hget('ic_user', $this->data['user_id']), true);
if(!$UserInfo || empty($UserInfo['union_id'])) if(!$UserInfo || empty($UserInfo['wechat_oauth']['open_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']); throw new \Exception('用户open_id获取失败#'.$this->data['id']);
//发放红包 //发放红包
$Url = config('system.wechat_api_url').'/payment/send/normal'; $Url = config('system.wechat_api_url').'/payment/send/balance';
$map = [ $map = [
'mch_billno' => 'integrals'.$this->data['id'], 'mch_billno' => 'integrals'.$this->data['id'],
're_openid' => $wechat['open_id'], 're_openid' => $UserInfo['wechat_oauth']['open_id'],
'total_amount' => $this->Exchange['amount'], 'total_amount' => $this->Exchange['amount'],
'wishing' => '天下都是我的,而我的都是你的!', 'remark' => '芯掌柜红包提现'
'act_name' => '红包提现',
'remark' => '芯掌柜'
]; ];
$data = ExcessEncryption($map,config('system.secretKey')); $data = ExcessEncryption($map,config('system.secretKey'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment