Example #1
0
 function C16Pr()
 {
     require './Wxin_V10C_150513/Prg/0000000000/000000000000.PHP';
     $date = array_filter(explode(",", $_GET['date']));
     //接受获取的参数
     $phone = array();
     //获取绑卡的手机号码
     $sendnum = array();
     //返回成功执行的数量
     $alldate = array();
     if (!empty($date)) {
         foreach ($date as $key => $getdate) {
             //增加改变数据功能
             $senddate = array_filter(explode("/", $getdate));
             array_push($phone, $senddate[0]);
             array_push($alldate, $senddate);
         }
         foreach ($this->dealWithPhone($phone) as $key) {
             WechatLog('openid---->' . var_export($key['f_fsfy_151010100200_004'], true));
             $openid = $key['f_fsfy_151010100200_004'];
             $cardid = $this->getCardid($alldate, $key['f_fsfy_151010100200_002']);
             WechatLog('getCardid---->' . var_export($cardid, true));
             $cheng = array('touser' => $openid, 'template_id' => "-wdEWgNGO2sFb53LxT-3_qcAzZmwFGEdaKI0Bh0rdDY", 'url' => "http://58.67.198.90/?IM_SRC=151010100203&cardid=" . $cardid . "&open_id=" . $openid, 'first' => "收到一份报告,请查看", 'keyword1' => date("Y-m-d H:i:s", time()), 'keyword2' => "你的筛查报告已经生成,点击进入查看详情", 'remark' => "医院地址:佛山市禅城区人民西路11号妇幼保健院行政后勤六楼");
             $access_token = $this->getAccess_token("gh_3fa7c3a973de");
             $tUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" . $access_token;
             $res = httpMsg($tUrl, urldecode(historyMsg($cheng)));
             WechatLog("模板发送记录=》" . var_export($res, true));
             array_push($sendnum, json_decode(serialize($res['errmsg'])));
         }
     }
     $this->updateCardidStatus($alldate);
     return array_count_values($sendnum);
 }
Example #2
0
 function C12Pr()
 {
     $cheng = array('touser' => "o2G8Bj-V1SSffXW9dJu4TlBk_TT8", 'template_id' => "-wdEWgNGO2sFb53LxT-3_qcAzZmwFGEdaKI0Bh0rdDY", 'url' => "http://58.67.198.90/?IM_SRC=140706000600", 'first' => "您的预约申请已经受理。", 'keyword1' => "通知时间:2015年6月20日", 'keyword2' => "知内容:您的预约申请已经受理,张XX医生将在XX日为您提供当面咨询服务。", 'remark' => "医院地址:XXXX");
     $access_token = $this->getAccess_token("gh_3fa7c3a973de");
     // $access_token = getWechatToken("gh_3fa7c3a973de");
     $tUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" . $access_token;
     $res = httpMsg($tUrl, urldecode(historyMsg($cheng)));
     WechatLog("res----=" . var_export($res, true));
 }