查询帝国cms的支付结果:
<?php require "../../class/connect.php"; require "../../class/db_sql.php"; require "../../class/q_functions.php"; require "../../member/class/user.php"; $link = db_connect(); $empire = new mysqlquery(); $editor = 1;
$orderid = RepPostVar($_GET['orderid']); if ($orderid) { if ($empire->gettotal("select count(*) as total from {$dbtbpre}enewspayrecord where orderid='$orderid' and status=1 limit 1")) { echo 'ok'; } }
db_close(); $empire = null; ?>
对应的前端代码是: //监听支付情况
setInterval("issuccess()",1000);
function issuccess(){
$.get('wxpay/issuccess.php',{'orderid':'<?=$outTradeNo?>'}, function(data) {
if(data=='ok'){
layer.msg('支付成功', {
icon: 1,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function(){
//支付成功后跳转的页面
window.location.href='<?=$gourl?>';
});
}
});
}
|