<?php
/**
* 答题挑战模块小程序接口定义
*
* @author huichuang
* @url http://bbs.we7.cc
*/
defined('IN_IA') or exit('Access Denied');
require_once IA_ROOT."/addons/hc_pdd/inc/model.class.php";
require_once IA_ROOT."/addons/hc_pdd/wxBizDataCrypt.php";
require_once IA_ROOT."/addons/hc_pdd/inc/api.class.php";
class Hc_pddModuleWxapp extends WeModuleWxapp {
public function doPageTest(){
ob_end_clean();
global $_GPC, $_W;
$post_url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token='.$this->wx_get_token();
$post_data = '';
$json = $this->api_notice_increment($post_url,$post_data);
$json=json_decode($json,true);
return $this->result(0, '获取成功',$json);
}
public function getToken(){
global $_GPC, $_W;
$account = pdo_get('account_wxapp', array('uniacid' => $_W['uniacid']));
$appid = $account['key'];
$appsecret = $account['secret'];
$file = file_get_contents("../addons/hc_pdd/access_token".$_W['uniacid'].".json",true);
$result = json_decode($file,true);
if(time() > $result['expires'] or empty($file)){
$data = array();
$data['access_token'] = $this->getNewToken($appid,$appsecret);
$data['expires']=time()+7000;
$jsonStr = json_encode($data);
$fp = fopen("../addons/hc_pdd/access_token".$_W['uniacid'].".json", "w");
fwrite($fp, $jsonStr);
fclose($fp);
return $data['access_token'];
}else{
return $result['access_token'];
}
}
public function getNewToken($appid,$appsecret){
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appid}&secret={$appsecret}";
$access_token_Arr = $this->https_request($url);
return $access_token_Arr['access_token'];
}
public function https_request($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$out = curl_exec($ch);
curl_close($ch);
return json_decode($out,true);
}
public function get_url_content($url)
{
$user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)";
//$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
//curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
//'Content-Length: ' . strlen($data_string)
));
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
public function doPageGetopenid()
{
ob_end_clean();
global $_GPC, $_W;
$code = $_GPC['code'];
$account = pdo_get('account_wxapp', array('uniacid' => $_GPC['i']));
$url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' . $account['key'] . '&secret=' . $account['secret'] . '&js_code=' . $code . '&grant_type=authorization_code';
$result = $this->get_url_content($url);
$result = json_decode($result, true);
return $this->result(0, '获取成功', $result);
}
public function doPageZhuce()
{
ob_end_clean();
global $_GPC, $_W;
$data['uniacid'] = $_GPC['i'];
$data['city'] = $_POST['city'];
$data['country'] = $_POST['country'];
$data['gender'] = $_POST['gender'];
$data['open_id'] = $_POST['openid'];
$data['nick_name'] = $_POST['nickname'];
$data['head_pic'] = $_POST['avatar'];
$data['province'] = $_POST['province'];
$stact = 1;
if(empty($data['open_id'])){
$this->result(0, $stact, '');
}
$uid = pdo_getcolumn('hcpdd_users', array('open_id' => $data['open_id'], 'uniacid' => $data['uniacid']), 'user_id', 1);
if (empty($uid)){
$stact = 0;
$data['fatherid'] = $_POST['activation'];
$data['pid'] = $this->CreatePid();
$result = pdo_insert('hcpdd_users', $data, $replace = true);
$uid = pdo_insertid();
$this->result(0, $stact,$uid);
}else{
$this->result(0, $stact,$uid);
}
}
//红包树注册
public function doPageTreezhuce()
{
ob_end_clean();
global $_GPC, $_W;
$data['uniacid'] = $_GPC['i'];
$data['city'] = $_POST['city'];
$data['country'] = $_POST['country'];
$data['gender'] = $_POST['gender'];
$data['open_id'] = $_POST['openid'];
$data['nick_name'] = $_POST['nickname'];
$data['head_pic'] = $_POST['avatar'];
$data['province'] = $_POST['province'];
$stact = 1;
if(empty($data['open_id'])){
$this->result(0, $stact, '');
}
$uid = pdo_getcolumn('hcpdd_users', array('open_id' => $data['open_id'], 'uniacid' => $data['uniacid']), 'user_id', 1);
if (empty($uid)){
$stact = 0;
/*if(!empty($_POST['user_id'])){
pdo_update('hcpdd_users', array('user_id' => $_POST['getuser_id']));
}*/
$data['fatherid'] = $_POST['activation'];
$data['pid'] = $this->CreatePid();
$result = pdo_insert('hcpdd_users', $data, $replace = true);
$uid = pdo_insertid();
if(!empty($_POST['outuser_id'])){
$set = pdo_get('hcpdd_set',array('uniacid'=>$_GPC['i']));
$father = pdo_get('hcpdd_users',array('uniacid'=>$_GPC['i'],'user_id'=>$_POST['outuser_id']));
$son = pdo_get('hcpdd_users',array('uniacid'=>$_GPC['i'],'user_id'=>$uid));
$min = $set['min_treemoney']*100;
$max = $set['max_treemoney']*100;
$aaa = mt_rand($min,$max);
$res['uniacid'] = $_GPC['i'];
$res['user_id'] = $_GPC['outuser_id'];
$res['hbmoney'] = $aaa/100;
$res['son_id'] = $uid;
$res['time'] = time();
$res['hb_id'] = $_GPC['hb_id'];
$fnowmoney = $father['treemoney'] + $res['hbmoney'];
$snowmoney = $son['treemoney'] + $res['hbmoney'];
pdo_update('hcpdd_users',array('treemoney'=>$fnowmoney), array('user_id' => $_POST['outuser_id']));
pdo_update('hcpdd_users',array('treemoney'=>$snowmoney), array('user_id' => $uid));
$pogba = pdo_insert('hcpdd_treelog', $res, $replace = true);
}
$arr['data'] = $uid;
$arr['hbmoney'] = $res['hbmoney'];
$this->result(0, $stact,$arr);
}else{
if(!empty($_POST['outuser_id'])){
$set = pdo_get('hcpdd_set',array('uniacid'=>$_GPC['i']));
$father = pdo_get('hcpdd_users',array('uniacid'=>$_GPC['i'],'user_id'=>$_POST['outuser_id']));
$son = pdo_get('hcpdd_users',array('uniacid'=>$_GPC['i'],'user_id'=>$uid));
$log = pdo_get('hcpdd_treelog',array('uniacid'=>$_GPC['i'],'son_id'=>$uid));
if(empty($log) and $uid<>$_POST['outuser_id']){
$min = $set['min_treemoney']*100;
$max = $set['max_treemoney']*100;
$aaa = mt_rand($min,$max);
$res['uniacid'] = $_GPC['i'];
$res['user_id'] = $_GPC['outuser_id'];
没有合适的资源?快使用搜索试试~ 我知道了~
[已测试]拼多多客京东客蘑菇街小程序V10.0.8完整全解密后端源码+小程序前端.rar
共1610个文件
png:679个
js:210个
html:153个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 64 浏览量
2022-07-10
10:01:43
上传
评论
收藏 68.84MB RAR 举报
温馨提示
产品优势: 1.无限开,可以创建无限个小程序。可以做流量矩阵,也可以无限倒卖。 2.后台一键自定义抽取佣金的比例,抽的佣金,全部归您所有。
资源推荐
资源详情
资源评论
收起资源包目录
[已测试]拼多多客京东客蘑菇街小程序V10.0.8完整全解密后端源码+小程序前端.rar (1610个子文件)
developer.cer 50B
layui.css 59KB
index.css 16KB
index.css 15KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
layui.mobile.css 10KB
game.css 7KB
game.css 6KB
bootstrap-switch.min.css 5KB
bootstrap-switch.min.css 5KB
layer.css 5KB
layer.css 5KB
layer.css 5KB
layer.css 5KB
jquery.bxslider.min.css 4KB
jquery.bxslider.min.css 4KB
area.css 3KB
area.css 3KB
style.css 3KB
style.css 3KB
bx_loader.gif 8KB
bx_loader.gif 8KB
loading-0.gif 6KB
loading-0.gif 6KB
loading-0.gif 6KB
loading-0.gif 6KB
bg_repno.gif 5KB
bg_repno.gif 5KB
5-121204193R0-50.gif 4KB
5-121204193R0-50.gif 4KB
20130527034920497.gif 3KB
20130527034920497.gif 3KB
loading-2.gif 2KB
loading-2.gif 2KB
loading-2.gif 2KB
loading-2.gif 2KB
loading-1.gif 701B
loading-1.gif 701B
loading-1.gif 701B
loading-1.gif 701B
软希网58soho.cn-虚拟资源下载平台-小程序、APP源码、整站源码、视频教程、精品源码、网站源码、游戏源码、文库素材、实用软件工具、商业源码、实用EXCEL_WORD_PPT文档等 (1).html 252KB
moguset.html 18KB
setting.html 15KB
commission_set.html 14KB
shenheset.html 14KB
shenheset.html 14KB
commission_set.html 14KB
play.html 12KB
play.html 12KB
moguset.html 11KB
play.html 11KB
play.html 11KB
theme.html 10KB
wphorders.html 10KB
nav_post.html 10KB
adv_post.html 9KB
diyname.html 9KB
moguorders.html 9KB
tuijian_post.html 8KB
pdd_orders.html 8KB
orders.html 8KB
adv_post.html 8KB
jdorders.html 8KB
jdtheme_post.html 8KB
hongbao.html 7KB
nav_post.html 6KB
couponlist.html 6KB
message.html 6KB
tuijian_post.html 6KB
showcoupon_post.html 6KB
finishorders.html 6KB
commission_jdorder.html 6KB
commission_moguorder.html 6KB
commission_wphorder.html 6KB
hongbao.html 6KB
commission_jdorder.html 6KB
commission_moguorder.html 6KB
finishorders.html 6KB
diyname.html 6KB
nav.html 6KB
tree.html 6KB
myteam.html 6KB
nav.html 5KB
theme.html 5KB
myteam.html 5KB
tree.html 5KB
wphso.html 5KB
pddtheme.html 5KB
adv.html 5KB
payset.html 5KB
top.html 5KB
moneyrate.html 5KB
show.html 5KB
addcoupon.html 5KB
payset.html 5KB
moneyrate.html 5KB
myteam_orders.html 5KB
共 1610 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
资源评论
- 宁静思新2022-11-10简直是宝藏资源,实用价值很高,支持!
- weixin_455654752023-07-29这个资源对我启发很大,受益匪浅,学到了很多,谢谢分享~
软希源码
- 粉丝: 3964
- 资源: 3535
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功