diff --git a/Application/Sdk/Controller/AppleController.class.php b/Application/Sdk/Controller/AppleController.class.php index 9992bf4a7..587fbc95f 100644 --- a/Application/Sdk/Controller/AppleController.class.php +++ b/Application/Sdk/Controller/AppleController.class.php @@ -37,9 +37,11 @@ class AppleController extends BaseController{ if (!$payCheck['code']) { $this->set_message(1088, "fail", $payCheck['msg']); } - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); - if($extend_data){ - $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); + if($extend_data){ + $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + } } file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']); if(pay_set_status('alipay')==1){ @@ -120,11 +122,12 @@ class AppleController extends BaseController{ if($request['price']*1<=0){ echo json_encode(['code'=>0,'msg'=>'充值金额有误']);exit; } - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); - if($extend_data){ - echo json_encode(['code'=>0,'msg'=>'订单号重复,请关闭支付页面重新支付']);exit; + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); + if($extend_data){ + echo json_encode(['code'=>0,'msg'=>'订单号重复,请关闭支付页面重新支付']);exit; + } } - $this->other_price($request); if(get_zfb_type()==0){ // 支付宝官方 @@ -385,10 +388,13 @@ class AppleController extends BaseController{ // $this->set_message(0,"fail","充值金额有误"); redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误')));exit; } - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); - if($extend_data){ - //$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); - redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['extend'].'订单号重复,请关闭支付页面重新支付')));exit; + + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); + if($extend_data){ + //$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['extend'].'订单号重复,请关闭支付页面重新支付')));exit; + } } $table = $request['code'] == 1 ? "spend" : "deposit"; $prefix = $request['code'] == 1 ? "SP_" : "PF_"; @@ -574,9 +580,11 @@ class AppleController extends BaseController{ C(api('Config/lists')); - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'game_status'=>1))->find(); - if($extend_data){ - redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'game_status'=>1))->find(); + if($extend_data){ + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; + } } $request['pay_way'] = 10; // 支付方式(-1绑币 0:平台币,1:支付宝,2:微信(扫码)3微信app 4 威富通 5聚宝云 6竣付通 7苹果支付8金猪支付 9双乾支付-支付宝 10双乾支付-银联 @@ -660,10 +668,12 @@ class AppleController extends BaseController{ // $this->set_message(0,"fail","充值金额有误"); redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误')));exit; } - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); - if($extend_data){ - // $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); - redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付')));exit; + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); + if($extend_data){ + // $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付')));exit; + } } $out_trade_no = "PF_" . date('Ymd') . date('His') . sp_random_string(4); $request['order_number'] = $out_trade_no; diff --git a/Application/Sdk/Controller/WapPayController.class.php b/Application/Sdk/Controller/WapPayController.class.php index 65408a71f..8e64461e1 100644 --- a/Application/Sdk/Controller/WapPayController.class.php +++ b/Application/Sdk/Controller/WapPayController.class.php @@ -78,7 +78,7 @@ class WapPayController extends BaseController{ if($game['pay_status'] == 0){ $this->set_message(0,"fail","该游戏暂时无法充值,请联系客服!"); } - if($request['code'] == 1){ + if($request['code'] == 1){ // 1正常充值 0平台币充值 $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find(); if($extend_data){ $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); @@ -498,9 +498,11 @@ class WapPayController extends BaseController{ C(api('Config/lists')); - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); - if($extend_data){ - redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); + if($extend_data){ + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; + } } $table = $request['code'] == 1 ? "spend" : "deposit"; @@ -574,9 +576,11 @@ class WapPayController extends BaseController{ if($game['pay_status'] == 0){ $this->set_message(0,"fail","该游戏暂时无法充值,请联系客服!"); } - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find(); - if($extend_data){ - $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + if($request['code'] == 1){ // 1正常充值 0平台币充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find(); + if($extend_data){ + $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + } } $table = $request['code'] == 1 ? "spend" : "deposit"; $prefix = $request['code'] == 1 ? "SP_" : "PF_"; @@ -887,9 +891,11 @@ class WapPayController extends BaseController{ C(api('Config/lists')); - $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); - if($extend_data){ - $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + if($request['code'] == 1){ // 1正常充值 0平台比充值 + $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); + if($extend_data){ + $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); + } } $table = $request['code'] == 1 ? "spend" : "deposit";