...
|
...
|
@@ -207,30 +207,37 @@ class Common extends Api |
|
|
{
|
|
|
//公众号所有粉丝openid
|
|
|
$LikeOpenid = $this->ListOpenid();
|
|
|
$options = [
|
|
|
'app_id' => 'wx3b0bb7a5d1e0722d', // AppID
|
|
|
'secret' => '104ac7dbcc57b778a7319d35d38ed9cd',
|
|
|
];
|
|
|
$app = new Application($options);
|
|
|
$userService = $app->user;
|
|
|
$users = $userService->batchGet($LikeOpenid);
|
|
|
dump($users);
|
|
|
die;
|
|
|
$notice = $app->notice;
|
|
|
$messageId = $notice->send([
|
|
|
'touser' => 'obtaR4jKqAts5e4Rp6ofEw7ftaes',
|
|
|
'template_id' => '3KUsUjjFnf3sf3meWIkAiVFhMM5U7Jgn3kyJFMFNPVc',
|
|
|
// 'url' => 'xxxxx',
|
|
|
'data' => [
|
|
|
'first' => 1,
|
|
|
'keyword1' => 2,
|
|
|
'keyword2' => 2,
|
|
|
'keyword3' => 2,
|
|
|
'keyword4' => 2,
|
|
|
'keyword5' => 2,
|
|
|
'remark' => 1
|
|
|
],
|
|
|
]);
|
|
|
return $messageId;
|
|
|
foreach ($LikeOpenid as $k => $v) {
|
|
|
$LikeOpenid[$k]['lang'] = 'zh_CN';
|
|
|
}
|
|
|
$token = $this->AccessToken();
|
|
|
$data['user_list'] = $LikeOpenid;
|
|
|
$res = $this->curlPost1('https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token=' . $token, $data);
|
|
|
dump($res);
|
|
|
// $options = [
|
|
|
// 'app_id' => 'wx3b0bb7a5d1e0722d', // AppID
|
|
|
// 'secret' => '104ac7dbcc57b778a7319d35d38ed9cd',
|
|
|
// ];
|
|
|
// $app = new Application($options);
|
|
|
// $userService = $app->user;
|
|
|
// $users = $userService->batchGet($LikeOpenid);
|
|
|
// dump($users);
|
|
|
// die;
|
|
|
// $notice = $app->notice;
|
|
|
// $messageId = $notice->send([
|
|
|
// 'touser' => 'obtaR4jKqAts5e4Rp6ofEw7ftaes',
|
|
|
// 'template_id' => '3KUsUjjFnf3sf3meWIkAiVFhMM5U7Jgn3kyJFMFNPVc',
|
|
|
//// 'url' => 'xxxxx',
|
|
|
// 'data' => [
|
|
|
// 'first' => 1,
|
|
|
// 'keyword1' => 2,
|
|
|
// 'keyword2' => 2,
|
|
|
// 'keyword3' => 2,
|
|
|
// 'keyword4' => 2,
|
|
|
// 'keyword5' => 2,
|
|
|
// 'remark' => 1
|
|
|
// ],
|
|
|
// ]);
|
|
|
// return $messageId;
|
|
|
}
|
|
|
} |
...
|
...
|
|