//接口请求
function click($url,$obj){
$obj['nonce_str'] = $this->create_noncestr();
$stringA = $this->create_qianming($obj,false);
$stringSignTemp = $stringA."&key=XADMH3SJYHHAJKA24RRU6LFSCXGADMIN";
$sign = strtoupper(md5($stringSignTemp));
$obj['sign'] = $sign;
$postXml = $this->arrayToXml($obj);
$responseXml = $this->curl_post_ssl($url,$postXml);
return $responseXml;
}
//核心
public function bonus_status(){
$mch_billno=$this->coupons_db->get_one("id={$_GET['id']}",'mch_billno,id','','','');
$id=$mch_billno['id'];
$obj2['mch_billno'] = $mch_billno['mch_billno'];
$obj2['mch_id'] = "1451750402";
$obj2['appid'] = "wxf118ea578e97539f";
$obj2['bill_type']= "MCHT";
$url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/gethbinfo";
$res = $this->pay($url,$obj2);
libxml_disable_entity_loader(true);
$postObj = simplexml_load_string($res, 'SimpleXMLElement', LIBXML_NOCDATA);
$val = json_decode(json_encode($postObj),true);
if($val['status']=="SENT"){
$status="已发放待领取";
}elseif($val['status']=="FAILED"){
$status="发放失败";
}elseif($val['status']=="RECEIVED"){
$status="已领取";
}elseif($val['status']=="REFUND"){
$status="已退款";
}
$table="co_weixin_coupons` as cp LEFT JOIN co_cacos as c ON cp.userid=c.`userid";
$where="cp.type=2 AND cp.userid={$_GET['userid']}";
$r = $this->coupons_db->get_one($where, "COUNT(cp.id) sum", "", "", $table);
$page = max(intval($_GET['page']), 1);
$total = $r['sum'];
$pages = pages($total, $page, 20);
$offset = ($page-1)*20;
$infos=$this->coupons_db->select($where,'cp.*,c.cc_name',$offset.', 20','cp.c_time DESC','','',$table);
$tui_userid=$infos['userid'];
include $this->admin_tpl('bonus_list');
}
PHP公众号发送完红包后查看领取状态 源码
猜你喜欢
转载自blog.csdn.net/qq_42805749/article/details/87936591
今日推荐
周排行