function C17Pr() { include './Fsfy_V10C_151008/Prg/0000000000/000000000001.PHP'; $appid = 'wxab617f2e3701ed23'; $secret = '57712d6c44976654956d7edf3743c83c'; WechatLog("get---->" . var_export($_GET, true)); //记录请求的数据 // unset($_SESSION['openid']); if (!empty($_GET['code'])) { WechatLog("-----code-----"); //记录请求的数据 $code = $_GET['code']; $requestUrl = 'https://api.weixin.qq.com/sns/oauth2/access_token?'; $getonceToken = $requestUrl . "appid=" . $appid . "&secret=" . $secret . "&code=" . $code . "&grant_type=authorization_code"; $json = $this->CurlGet($getonceToken); WechatLog("临时的token" . var_export($json, true)); //记录请求的数据 if ($json) { $jsonArr = json_decode($json, true); $getOpenid = "https://api.weixin.qq.com/sns/userinfo?access_token=" . $jsonArr['access_token'] . "&openid=" . $jsonArr['openid']; $userinfo_json = $this->CurlGet($getOpenid); $userMsg = json_decode($userinfo_json, true); $_SESSION['openid'] = $userMsg['openid']; var_dump($userMsg); WechatLog("用户的信息" . var_export($userMsg, true)); //记录请求的数据 //echo $userinfo_json['openid'];die; } } if (!isset($_SESSION['openid'])) { WechatLog("null -openid---->" . var_export('wei kong---->>', true)); //记录请求的数据 $url = 'https://open.weixin.qq.com/connect/oauth2/authorize'; $redirect_uri = 'http://dev.369itil.com/?IM_SRC=151010100203&IM_HND=17'; $elseurl = '&act=select&response_type=code&scope=snsapi_userinfo&state=2#wechat_redirect'; $rqurl = $url . '?appid=' . $appid . '&redirect_uri=' . $redirect_uri . $elseurl; header('Location:' . $rqurl); exit; } // 根据openid获取卡信息 $_OBJECT =& $this->APPObj; // $_IMPORT = &$this->IMPORT; $_RESULT =& $this->Result; $cField = "*"; //查找的字段 $cWhere = "{~}f_fsfy_151010100200_004{_}=={_}" . $_SESSION['openid']; //帅选条件 $cUSafe = "4"; //安全级别 $cUSort = "f_fsfy_151010100200_000 asc"; //排序 $cDWxin_V10C_150513 = Vic_Dir_Search("151010100200.INI", "/" . $this->APPCls->Getvar("RunPath") . "/Sql/", 0, "T"); $cUsrWK = Common::$_UsrInf->Getvar("UsrWK"); $_RESULT = $_OBJECT["DB"]->GetSource($cUsrWK, $cUSafe, $cDWxin_V10C_150513, $cField, $cWhere, $cUSort, NULL, -1); $data = $_RESULT->Resgrd; // echo count($data);die; echo $data[0]['f_fsfy_151010100200_002']; die; // $this->APPTml->Setvar("list",$wind); }
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); }
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)); }