...
|
...
|
@@ -24,6 +24,46 @@ Route::any('plugin/[:_plugin]/[:_controller]/[:_action]', "\\cmf\\controller\\Pl |
|
|
Route::get('captcha/new', "\\cmf\\controller\\CaptchaController@index");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sendSubMessage($data,$openId = "openId",$tmpl = "i32dB8tFiNFYRgRGM6bv79aEe4X2_BZ8HunwaoPw58o"){
|
|
|
$params['touser'] = $openId;
|
|
|
$params['template_id'] = $tmpl;
|
|
|
$params['page'] = "/pages/index/index";
|
|
|
$params['data'] = $data;
|
|
|
|
|
|
$appId = 'wx7a3bf4e0796c070a';
|
|
|
$secret = '755478f064e09a8301345e0c427c6cf3';
|
|
|
$config = [
|
|
|
'app_id' => $appId,
|
|
|
'secret' => $secret,
|
|
|
];
|
|
|
$app=new \EasyWeChat\Foundation\Application($config);
|
|
|
$accessToken = $app->access_token;
|
|
|
$token = $accessToken->getToken();
|
|
|
$accessToken=$token;
|
|
|
$url='https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token='.$accessToken;
|
|
|
return curlPost1($url,$params);
|
|
|
}
|
|
|
|
|
|
function curlPost1($url,$data){
|
|
|
$ch = curl_init();
|
|
|
$postJosnData = json_encode($data);
|
|
|
$ch = curl_init($url);
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $postJosnData);
|
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
|
|
$data = curl_exec($ch);
|
|
|
return $data;
|
|
|
// dump($data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取志愿者状态
|
|
|
* @param $work_time
|
...
|
...
|
|