您的位置:首页 > 编程语言 > PHP开发

更新用户充值状态 Monxin专用(PHP代码函数)

2015-04-07 10:17 621 查看
//更新用户充值状态 Monxin专用(PHP代码函数)
//本代码基于Monxin 运行
//代码来源:Monxin ./config/functions.php

function update_recharge($pdo,$language,$id){
$id=intval($id);
$sql="select `state` from ".$pdo->index_pre."recharge where `id`='$id'";
$r=$pdo->query($sql,2)->fetch(2);
if($r['state']==4){return true;}

$sql="update ".$pdo->index_pre."recharge set `state`='4' where `id`='$id' and `state`='2'";
if($pdo->exec($sql)){
$sql="select `username`,`money` from ".$pdo->index_pre."recharge where `id`='$id'";
$r=$pdo->query($sql,2)->fetch(2);
if($r['username']!=''){
if(operator_money($language,$pdo,$r['username'],$r['money'],$language['recharge'],'index')){
return true;
}else{
$sql="update ".$pdo->index_pre."recharge set `state`='2' where `id`='$id' and `state`='4'";
if(!$pdo->exec($sql)){
add_err_log($sql);
}
return false;
}
}else{
return true;
}
}else{
return false;
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: