|
|
|
@ -470,17 +470,14 @@ class Server |
|
|
|
|
$result = $this->curlPost($url, json_encode($data)); |
|
|
|
|
$result = json_decode($result, true); |
|
|
|
|
if (!empty($result['authorization_info']['authorizer_access_token'])) { |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => '获取到给客户发送信息token', 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
$token = $result['authorization_info']['authorizer_access_token']; |
|
|
|
|
$url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=' . $token; |
|
|
|
|
$data = []; |
|
|
|
|
$data['touser'] = $touser; |
|
|
|
|
$data['msgtype'] = 'text'; |
|
|
|
|
$data['text'] = [ |
|
|
|
|
'content' => $authorization_code . '$_from_api', |
|
|
|
|
$data = [ |
|
|
|
|
'touser' => $touser, |
|
|
|
|
'msgtype' => 'text', |
|
|
|
|
'text' => ['content' => $authorization_code . '_from_api'], |
|
|
|
|
]; |
|
|
|
|
$arr = $this->curlPost($url, json_encode($data)); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($arr), 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
$this->curlPost($url, json_encode($data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|