Merge branch 'master' of http://app.git.1nww.com:8188/gitlab-instance-db4ab2e7/cxhxy
This commit is contained in:
commit
bdecbb1c0b
@ -66,8 +66,8 @@ class Index
|
||||
|
||||
$wx_url = 'https://api.weixin.qq.com/cgi-bin/user/info?access_token=' . $access_token . '&openid=' . $openid . '&lang=zh_CN';
|
||||
$info = Http::get($wx_url);
|
||||
$info=json_decode($info,true);
|
||||
|
||||
$info = json_decode($info, true);
|
||||
|
||||
|
||||
$unionid = $info['unionid'];
|
||||
|
||||
@ -101,17 +101,19 @@ class Index
|
||||
Db::name('food_coupon_user_wx')->insert($data1);
|
||||
Db::name('food_coupon_user_wx')->insert($data2);
|
||||
Db::commit();
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
write_log(json_encode($e->getMessage()), __DIR__);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$appid='wx89c12dd426a55a2e';
|
||||
$wx_redirect_uri = 'https://app.cxhxy.dev.1nww.com/api/food.user/wxLogin';
|
||||
$redirect_uri = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri={$wx_redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
|
||||
|
||||
|
||||
//发送公众号消息
|
||||
$url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=' . $access_token;
|
||||
$queryarr = [
|
||||
@ -122,7 +124,7 @@ class Index
|
||||
[
|
||||
'title' => '您有一张新的优惠券,请及时领取',
|
||||
'description' => '黄辛一新人优惠,首次关注赠送优惠券',
|
||||
'url' => 'https://www.baidu.com',
|
||||
'url' => $redirect_uri,
|
||||
'picurl' => 'https://www.baidu.com',
|
||||
]
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user