重复点击充值

平台币充值提示问题。
master
tpingzhang 5 years ago
parent 63f2fa47b5
commit efae40fa2e

@ -171,7 +171,7 @@ class AppleController extends BaseController{
} }
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$sqpay=new Sqpay(); $sqpay=new Sqpay();
$returl = C('pay_header'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id']; $returl = C('pay_header'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
@ -226,7 +226,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$goldpig=new GoldPig(); $goldpig=new GoldPig();
@ -395,7 +395,7 @@ class AppleController extends BaseController{
$discount = $this->get_discount($request['game_id'],$user['promote_id'],$request['user_id']); $discount = $this->get_discount($request['game_id'],$user['promote_id'],$request['user_id']);
$discount = $discount['discount']; $discount = $discount['discount'];
$pay_amount = $discount * $request['price'] / 10; $pay_amount = $discount * $request['price'] / 10;
file_put_contents(dirname(__FILE__).'/1222222.txt',get_wx_pay_type()); // file_put_contents(dirname(__FILE__).'/1222222.txt',get_wx_pay_type());
// 绑币平台币优先处理 // 绑币平台币优先处理
$this->other_price($request, $discountAmount); $this->other_price($request, $discountAmount);
@ -408,7 +408,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.(is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ; $json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.(is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ;
@ -420,7 +420,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$pay['agent_id'] = C('heepay.partner');//商户号 $pay['agent_id'] = C('heepay.partner');//商户号
@ -445,7 +445,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$jtpay=new Jtpay(); $jtpay=new Jtpay();
@ -466,7 +466,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
/*$goldpig=new GoldPig(); /*$goldpig=new GoldPig();
@ -490,7 +490,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$pay['agent_id'] = C('heepay.partner');//商户号 $pay['agent_id'] = C('heepay.partner');//商户号
@ -526,7 +526,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$json_data['url']=$url['pay_info']; $json_data['url']=$url['pay_info'];
}else{ }else{
@ -596,7 +596,7 @@ class AppleController extends BaseController{
if($request['code']==1){ if($request['code']==1){
$this->add_spend($request,1); $this->add_spend($request,1);
}else{ }else{
$this->add_deposit($request); $this->add_deposit($request, 1);
} }
$sqpay=new Sqpay(); $sqpay=new Sqpay();
$returl = 'http://' . $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id']; $returl = 'http://' . $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];

@ -533,11 +533,18 @@ class BaseController extends RestController{
/* /*
*平台币充值记录 *平台币充值记录
*/ */
public function add_deposit($data){ public function add_deposit($data, $type=0){
$deposit = M("deposit","tab_"); $deposit = M("deposit","tab_");
$deposit_data = $this->deposit_param($data); $deposit_data = $this->deposit_param($data);
$ordercheck = $deposit->where(array('pay_order_number'=>$deposit_data["pay_order_number"]))->find(); $ordercheck = $deposit->where(array('pay_order_number'=>$deposit_data["pay_order_number"]))->find();
if($ordercheck)$this->set_message(0,'fail',"订单已经存在,请刷新充值页面重新下单!"); if($ordercheck) {
if ($type) {
redirect(U('Spend/notice',array('user_id'=>$ordercheck['user_id'],'game_id'=>$ordercheck['game_id'],'msg'=>'订单已经存在,请刷新充值页面重新下单!')));
exit;
} else {
$this->set_message(0,'fail',"订单已经存在,请刷新充值页面重新下单!");
}
}
// if(!is_check_apply_promote($deposit_data['game_id'],$deposit_data['promote_id'])){ // if(!is_check_apply_promote($deposit_data['game_id'],$deposit_data['promote_id'])){
// $deposit_data['promote_id']=0; // $deposit_data['promote_id']=0;
// $deposit_data['promote_account']="自然注册"; // $deposit_data['promote_account']="自然注册";

@ -180,6 +180,10 @@
} }
$(function() { $(function() {
$(".recharge_way_wrap a").one("click",function(){
$(this).click(function (){return false;});
});
$('#platform_id').on('click',function() { $('#platform_id').on('click',function() {
$('#platform_pop').fadeIn().find('#platform_pop_close').on('click',function() { $('#platform_pop').fadeIn().find('#platform_pop_close').on('click',function() {
$(this).closest('#platform_pop').fadeOut(); $(this).closest('#platform_pop').fadeOut();

Loading…
Cancel
Save