<?php
/**
* 本破解程序由资源邦提供
* 资源邦www.wazyb.com
* QQ:993424780 承接网站建设、公众号搭建、小程序建设、企业网站
*/
defined('IN_IA') or exit('Access Denied');
class Weixinmao_houseModuleWxapp extends WeModuleWxapp {
public function GetSiteUrl()
{
global $_GPC, $_W;
if($_W['attachurl']!=""){
$siteurl = $_W['attachurl'];
}else{
$siteurl = $_W['siteroot'].'attachment/';
}
return $siteurl;
}
public function IsCheck()
{
global $_GPC, $_W;
$intro = pdo_fetch("SELECT ischeck FROM " . tablename('weixinmao_house_intro')." WHERE uniacid=:uniacid",array(":uniacid" => $_W['uniacid']));
return $intro['ischeck'];
}
public function IsAgent()
{
global $_GPC, $_W;
$intro = pdo_fetch("SELECT isagent FROM " . tablename('weixinmao_house_intro')." WHERE uniacid=:uniacid",array(":uniacid" => $_W['uniacid']));
return $intro['isagent'];
}
public function IsCheck2()
{
global $_GPC, $_W;
$intro = pdo_fetch("SELECT ischeck2 FROM " . tablename('weixinmao_house_intro')." WHERE uniacid=:uniacid",array(":uniacid" => $_W['uniacid']));
return $intro['ischeck2'];
}
public function doPageTalk(){
global $_GPC, $_W;
$token = 'abc123abc';
//echo $token;
$echoStr = $_GET["echostr"];
$this->responseMsg();
if ($this->checkSignature($token)) {
echo $echoStr;
exit;
}
}
public function checkSignature($token) //官方的验证函数
{
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = $token;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
return true;
}else{
return false;
}
}
public function responseMsg()
{
$fromUsername = $postArr['FromUserName']; //发送者openid
$content = '您好,有什么能帮助你?';
$data=array(
"touser"=>$fromUsername,
"msgtype"=>"text",
"text"=>array("content"=>$content)
);
$json = json_encode($data,JSON_UNESCAPED_UNICODE); //php5.4+
$access_token = $this->get_accessToken();
/*
* POST发送https请求客服接口api
*/
$url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=".$access_token;
//以'json'格式发送post的https请求
error_reporting(0);
$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($json)){
curl_setopt($curl, CURLOPT_POSTFIELDS,$json);
}
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);
if($output == 0){
echo 'success';exit;
}
}
public function doPagedelSaleinfo(){
global $_GPC, $_W;
$id = $_GPC['id'];
pdo_delete('weixinmao_house_saleinfo', array('id' => $id));
return $this->result(0, 'success', $list);
}
public function doPagedelSaleinfo2(){
global $_GPC, $_W;
$id = $_GPC['id'];
$sessionid = $_GPC['sessionid'];
$ordertype = $_GPC['ordertype']? $_GPC['ordertype'] : 1;
if($ordertype == 1)
// $condition = " type = 1 AND ";
$saletable = 'weixinmao_house_saleinfo';
elseif($ordertype == 2)
//$condition = " type = 2 AND ";
$saletable = 'weixinmao_house_carsaleinfo';
elseif($ordertype == 3)
// $condition = " type = 3 AND ";
$saletable = 'weixinmao_house_shopsaleinfo';
elseif($ordertype == 4)
//$condition = " type = 4 AND ";
$saletable = 'weixinmao_house_buesaleinfo';
pdo_delete($saletable, array('id' => $id));
return $this->result(0, 'success', $list);
}
public function doPagedelOldhouseinfo(){
global $_GPC, $_W;
$id = $_GPC['id'];
pdo_delete('weixinmao_house_oldhouseinfo', array('id' => $id));
return $this->result(0, 'success', $list);
}
public function doPagedelLethouseinfo()
{
global $_GPC, $_W;
$id = $_GPC['id'];
pdo_delete('weixinmao_house_lethouseinfo', array('id' => $id));
return $this->result(0, 'success', $list);
}
public function doPageGetcity()
{
global $_GPC, $_W;
$sql = 'SELECT * FROM ' . tablename('weixinmao_house_area') . ' WHERE `uniacid` = :uniacid ORDER BY `sort` DESC';
$arealist = pdo_fetchall($sql, array(':uniacid' => $_W['uniacid']));
return $this->result(0, 'success', $arealist);
}
public function httpGet($url) {
error_reporting(0);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);
return $res;
}
public function doPageGetphone()
{
global $_GPC, $_W;
include "inc/wxBizDataCrypt.php";
//var_dump($is);
// $code = $_GET['code'];
$iv = $_GPC['iv'];
$encryptedData = $_GPC['encryptedData'];
$appid = $_W['uniaccount']['key'];;//小程序唯一标识 (在微信小程序管理后台获取)
$appsecret = $_W['uniaccount']['secret'];//小程序的 app secret (在微信小程序管理后台获取)
// $grant_type = "authorization_code"; //授权(必填)
// $params = "appid=".$appid."&secret=".$appsecret."&js_code=".$code."&grant_type=".$grant_type;
// $url = "https://api.weixin.qq.com/sns/jscode2session?".$params;
// $res = json_decode($this->httpGet($url),true);
//json_decode不加参数true,转成的就不是array,而是对象。 下面的的取值会报错 Fatal error: Cannot use object of type stdClass as array in
// $sessionKey = $res['session_key'];//取出json里对应的值
//echo $_SESSION['session_key'];
$pc = new WXBizDataCrypt($appid, $_SESSION['session_key']);
// var_dump($pc);
// echo $encryptedData, $iv;
$errCode = $pc->decryptData($encryptedData, $iv, $data);
$obj = json_decode($data);
$uid = $_GPC['uid'];
$tel = $obj->phoneNumber;
// echo $tel;
pdo_update('weixinmao_house_userinfo',array('tel'=>$tel),array('uid'=>$uid));
return $this->result(0, 'success', array());
}
public function doPageGetcitylist()
{
global $_GPC, $_W;
$condition_hot = " WHERE ishot = 1 AND uniacid=:uniacid ORDER BY sort DESC ";
$sql = 'SELECT id ,name FROM ' . tablename('weixinmao_house_city') . $condition_hot ;
$hotlist = pdo_fetchall($sql,array(":uniacid" => $_W['uniacid']));
$condition = " WHERE uniacid=:uniacid GROUP BY firstname ORDER BY firstname ,sort DESC";
$sql = 'SELECT firstname FROM ' . tablename('weixinmao_house_city') . $condition ;
$firstnamelist = pdo_fetchall($sql,array(":uniacid" => $_W['uniacid']));
$conditionlist = " WHERE uniacid=:uniacid AND firstname=:firstname ";
$sql = 'SELECT id ,name FROM ' . tablename('weixinmao_house_city') . $conditionlist ;
foreach($firstnamelist AS $k=>$v)
{
$list = pdo_fetchall($sql,array(":uniacid" => $_W['uniacid'],':firstname

coding已疯狂
- 粉丝: 1320
- 资源: 2583
最新资源
- 10种混沌映射优化灰狼算法:一键切换,通用群智能算法优化.pdf
- 10自由度传动系统模型:包含解释文档、Simulink模型及简易理解.pdf
- 11# 三菱PLC组态王自动洗车控制系统组态模拟仿真程序.pdf
- 11.2版本 SLM模拟教程:使用Flow3D软件进行增材制造中选区激光熔化数值模拟.pdf
- 11.2版本SLM模拟教程:使用流体力学软件Flow3d进行增材制造数值模拟.pdf
- 11.2版本:使用Flow3D进行高能量密度下选区激光熔化(SLM)数值模拟与计算流体动力学(CFD)分析.pdf
- 11_2直流微电网:包含PV+MPPT、DCDC储能、三相并网(PQ控制)及三相负载(VF控制),波形优美的微电网系统.pdf
- 11-2kw双向储能变换器仿真:pfcllc结构,整流逆变模式自由切换.pdf
- 11kw OBC 三相PFC仿真模型:包含管子Spice模型与功率因数校正技术.pdf
- 11KW OBC两电平pfc+cllc单相与三相兼容仿真,双向控制源代码实现.pdf
- 11-trans顶刊代码复现:基于Lyapunov方法的欠驱动无人船USV路径跟踪与轨迹跟踪控制(使用MATLAB Simulink建模与Fossen模型非线性控制方法).pdf
- 11电平级联H桥仿真模型:开环仿真与载波移相控制,适合初学者学习.pdf
- 11套QT_c++和C#工业上位机MES编程:现场应用全解析.pdf
- 11电平三相MMC逆变器并网:双闭环控制与载波移相调制技术.pdf
- 11-基于遗传算法的微电网经济运行优化:多目标优化与单目标转换.pdf
- 11种概率分布的拟合与KS检验:MATLAB代码详解及实践指南.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


