作者 sgj
1 个管道 的构建 失败 耗费 9 秒

打卡操作

... ... @@ -1444,4 +1444,13 @@ class SecondController extends RestBaseController
$this->success('操作完成');
}
public function test(){
$data=[];
$openId='o-_vH5TbLrdztwa7nzj5Ocei-hdY';
$Info=sendSubMessage($data,$openId);
dump($Info);
}
}
\ No newline at end of file
... ...
... ... @@ -43,6 +43,7 @@ class AdminLogController extends AdminBaseController
'page'=>$data->render(),
]);
return $this->fetch();
cmf_get_image_url();
}
}
\ No newline at end of file
... ...
... ... @@ -288,14 +288,16 @@
callback:function(selectedLocation){
var lat = document.getElementById('lat');
var lng = document.getElementById('lng');
var address_name = document.getElementById('address_name');
console.log(selectedLocation);
var gps=selectedLocation.location.split(",");
var gps=selectedLocation.latlng;
if (gps==''){
return false;
}
console.log(gps)
lat.value =gps['1'];
lng.value =gps['0'];
lat.value =gps.lat;
lng.value =gps.lng;
address_name.value=selectedLocation.poiaddress+selectedLocation.poiname
}
});
</script>
... ...
... ... @@ -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
... ...