<?php
/**
* 本破解程序由资源邦提供
* 资源邦www.wazyb.com
* QQ:993424780 承接网站建设、公众号搭建、小程序建设、企业网站
*/
defined('IN_IA') or exit('Access Denied');
class hyb_ylmzModuleWxapp extends WeModuleWxapp {
//保存用户fomid
public function doPageSaveformids(){
global $_GPC, $_W;
$uniacid =$_W['uniacid'];
$openId = $_GPC['openid'];
$formId = $_GPC['formId'];//获取formIds数组
$data = array(
'formid'=>$formId,
);
$singinfo =pdo_update('hyb_ylmz_keshi_yuyue',$data,array('uniacid'=>$uniacid,'ky_openid'=>$openId));
return $this->result(0, 'success', $singinfo);
}
//获取token
public function doPageAccessToken(){
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$mbsz = pdo_fetch("SELECT * FROM " .tablename('hyb_ylmz_duanxin')." where `uniacid`='{$uniacid}'" );
$form_id =$_REQUEST['formId'];
$template_id = $mbsz['wxapptpl'];
$id = intval($_REQUEST['ky_id']);
$singinfo =pdo_fetch("SELECT * FROM " .tablename('hyb_ylmz_keshi_yuyue')." where `ky_id` = '{$id}' and `uniacid`='{$uniacid}' " );
$openid = $singinfo['ky_openid'];
$timea= date("Y-m-d H:i:s",time());//时间
$start_time= $singinfo['ky_doctor'].'已确认您的订单';//温馨提示
$star_m =$singinfo['ky_yibao'];//交易单号
if($singinfo['ky_hexiao']=='1'){
$state ='已支付';
}else{
$state ='待支付';
}
$end_time= $state;//支付状态
$page="hyb_ylmz/personal_page/detail/doctor_detail/doctor_detail?id=".$id;
$result = pdo_fetch('SELECT * FROM ' . tablename('hyb_ylmz_parameter') . " where `uniacid`='{$uniacid}' ");
$APPID = $result['appid'];
$SECRET = $result['appsecret'];
$tokenUrl="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$APPID}&secret={$SECRET}";
$getArr=array();
$tokenArr=json_decode($this->send_post($tokenUrl,$getArr,"GET"));
$access_token=$tokenArr->access_token;
$url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token='.$access_token ;
$value = array(
"keyword1"=>array(
"value"=> $timea,
"color"=>"#4a4a4a"
),
"keyword2"=>array(
"value"=>$start_time,
"color"=>"#9b9b9b"
),
"keyword3"=>array(
"value"=>$star_m,
"color"=>"#9b9b9b"
),
"keyword4"=>array(
"value"=>$end_time,
"color"=>"#9b9b9b"
),
);
$dd = array();
$dd['touser']=$openid;
$dd['template_id']=$template_id;
$dd['page']=$page; //1517033709028点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,该字段不填则模板无跳转。
$dd['form_id']=$singinfo['formid'];
$dd['data']=$value; //模板内容,不填则下发空模板
$dd['color']=''; //模板内容字体的颜色,不填默认黑色
$dd['emphasis_keyword']=''; //模板需要放大的关键词,不填则默认无放大
$result = $this->https_curl_json($url,$dd,'json');
if($result){
echo json_encode(array('state'=>5,'msg'=>$result));
}else{
echo json_encode(array('state'=>5,'msg'=>$result));
}
return $this->result(0, 'success', $result);
}
private function https_curl_json($url,$data,$type){
if($type=='json'){
$headers = array("Content-type: application/json;charset=UTF-8","Accept: application/json","Cache-Control: no-cache", "Pragma: no-cache");
$data=json_encode($data);
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
if (!empty($data)){
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS,$data);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers );
$output = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Errno'.curl_error($curl);//捕抓异常
}
curl_close($curl);
return $output;
}
private function send_post($url, $post_data,$method='POST') {
$postdata = http_build_query($post_data);
$options = array(
'http' => array(
'method' => $method, //or GET
'header' => 'Content-type:application/x-www-form-urlencoded',
'content' => $postdata,
'timeout' => 15 * 60 // 超时时间(单位:s)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
return $result;
}
//短信通知
public function doPageSendSms(){
require_once dirname(__FILE__) .'/inc/SignatureHelper.php';
$params = array ();
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$phoneNum = $_GPC['tel'];
$aliduanxin = pdo_fetch("SELECT * FROM ".tablename("hyb_ylmz_duanxin")."WHERE uniacid = '{$uniacid}' " ,array("uniacid"=>$uniacid));
if($aliduanxin['state'] == 1){
$accessKeyId = $aliduanxin['key'];
$accessKeySecret = $aliduanxin['scret'];
$params["PhoneNumbers"] = $aliduanxin['administrator'];
$params["SignName"] = $aliduanxin['qianming'];
$params["TemplateCode"] = $aliduanxin['moban_id'];
$name = $_GPC['name'];
$ksname = $_GPC['c_name'];
$doctor = $_GPC['ky_doctor'];
$params['TemplateParam'] = Array (
'content'=>$phoneNum,
'name'=>$name,
'ksname'=>$ksname,
'doctor'=>$doctor
);
if(!empty($params["TemplateParam"]) && is_array($params["TemplateParam"])) {
$params["TemplateParam"] = json_encode($params["TemplateParam"]);
}
$helper = new SignatureHelper();
$content = $helper->request(
$accessKeyId,
$accessKeySecret,
"dysmsapi.aliyuncs.com",
array_merge($params, array(
"RegionId" => "cn-hangzhou",
"Action" => "SendSms",
"Version" => "2017-05-25",
))
);
}
return $this->result(0, 'success',$content);
}
//排号通知
public function doPagePhtz(){
require_once dirname(__FILE__) .'/inc/SignatureHelper.php';
$params = array ();
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$phoneNum = $_GPC['tel'];
$aliduanxin = pdo_fetch("SELECT * FROM ".tablename("hyb_ylmz_duanxin")."WHERE uniacid = '{$uniacid}' " ,array("uniacid"=>$uniacid));
if($aliduanxin['state'] == 1){
$accessKeyId = $aliduanxin['key'];
$accessKeySecret = $aliduanxin['scret'];
$tel =$_GPC['tel'];
$params["PhoneNumbers"] = $tel;
$params["SignName"] = $aliduanxin['qianming'];
$params["TemplateCode"] = $aliduanxin['phtpl'];
$zid = $_GPC['zid'];
$pdoinfo = pdo_fetch("SELECT * FROM ".tablename("hyb_ylmz_doctor")."as a left join".tablename('hyb_ylmz_kscate')."as b on b.c_id = a.z_pid WHERE a.uniacid = '{$uniacid}'and a.zid = '{$zid}'" ,array("uniacid"=>$uniacid));
$openid = $_GPC['openid'];
$myinfo = pdo_fetch("SELECT * FROM " .tablename('hyb_ylmz_reg')."WHERE uniacid = '{$uniacid}' a
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
医疗门诊小程序V3.2.3全开源完整安装包+小程序前端 (460个子文件)
35.gif 13KB
42.gif 13KB
40.gif 10KB
18.gif 8KB
19.gif 8KB
11.gif 8KB
32.gif 7KB
49.gif 6KB
29.gif 6KB
97.gif 5KB
65.gif 5KB
31.gif 5KB
46.gif 5KB
57.gif 5KB
45.gif 5KB
08.gif 5KB
43.gif 4KB
33.gif 4KB
68.gif 4KB
26.gif 4KB
14.gif 4KB
07.gif 4KB
51.gif 4KB
10.gif 4KB
47.gif 4KB
72.gif 4KB
06.gif 3KB
94.gif 3KB
84.gif 3KB
41.gif 3KB
17.gif 3KB
09.gif 3KB
28.gif 3KB
50.gif 3KB
95.gif 3KB
22.gif 3KB
27.gif 3KB
67.gif 3KB
90.gif 3KB
60.gif 3KB
58.gif 3KB
74.gif 2KB
25.gif 2KB
101.gif 2KB
54.gif 2KB
99.gif 2KB
24.gif 2KB
12.gif 2KB
73.gif 2KB
104.gif 2KB
103.gif 2KB
34.gif 2KB
88.gif 2KB
53.gif 2KB
04.gif 2KB
23.gif 2KB
05.gif 2KB
21.gif 2KB
03.gif 2KB
00.gif 2KB
20.gif 2KB
02.gif 2KB
39.gif 2KB
96.gif 2KB
30.gif 2KB
100.gif 2KB
48.gif 2KB
13.gif 2KB
38.gif 2KB
98.gif 2KB
83.gif 2KB
81.gif 2KB
55.gif 2KB
01.gif 2KB
85.gif 2KB
44.gif 2KB
78.gif 2KB
15.gif 2KB
87.gif 2KB
82.gif 2KB
80.gif 2KB
59.gif 1KB
52.gif 1KB
86.gif 1KB
79.gif 1KB
102.gif 1KB
36.gif 1KB
16.gif 1KB
92.gif 1KB
105.gif 1KB
62.gif 1KB
75.gif 1KB
89.gif 1KB
76.gif 1KB
37.gif 1KB
56.gif 1KB
70.gif 1KB
66.gif 1KB
77.gif 1KB
61.gif 1KB
共 460 条
- 1
- 2
- 3
- 4
- 5
王乾亨
- 粉丝: 35
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页