正常充值不需要验证spend表 是否重复充值

master
tpingzhang 5 years ago
parent e30580791e
commit 464e9f244b

@ -37,9 +37,11 @@ class AppleController extends BaseController{
if (!$payCheck['code']) { if (!$payCheck['code']) {
$this->set_message(1088, "fail", $payCheck['msg']); $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($request['code'] == 1){ // 1正常充值 0平台币充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); if($extend_data){
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
}
} }
file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']); file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']);
if(pay_set_status('alipay')==1){ if(pay_set_status('alipay')==1){
@ -120,11 +122,12 @@ class AppleController extends BaseController{
if($request['price']*1<=0){ if($request['price']*1<=0){
echo json_encode(['code'=>0,'msg'=>'充值金额有误']);exit; 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($request['code'] == 1){ // 1正常充值 0平台币充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
echo json_encode(['code'=>0,'msg'=>'订单号重复,请关闭支付页面重新支付']);exit; if($extend_data){
echo json_encode(['code'=>0,'msg'=>'订单号重复,请关闭支付页面重新支付']);exit;
}
} }
$this->other_price($request); $this->other_price($request);
if(get_zfb_type()==0){ // 支付宝官方 if(get_zfb_type()==0){ // 支付宝官方
@ -385,10 +388,13 @@ class AppleController extends BaseController{
// $this->set_message(0,"fail","充值金额有误"); // $this->set_message(0,"fail","充值金额有误");
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误')));exit; 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){ if($request['code'] == 1){ // 1正常充值 0平台币充值
//$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['extend'].'订单号重复,请关闭支付页面重新支付')));exit; 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"; $table = $request['code'] == 1 ? "spend" : "deposit";
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; $prefix = $request['code'] == 1 ? "SP_" : "PF_";
@ -574,9 +580,11 @@ class AppleController extends BaseController{
C(api('Config/lists')); C(api('Config/lists'));
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'game_status'=>1))->find(); if($request['code'] == 1){ // 1正常充值 0平台币充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'game_status'=>1))->find();
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; 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双乾支付-银联 $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","充值金额有误"); // $this->set_message(0,"fail","充值金额有误");
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误')));exit; 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($request['code'] == 1){ // 1正常充值 0平台币充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
// $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); if($extend_data){
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付')));exit; // $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); $out_trade_no = "PF_" . date('Ymd') . date('His') . sp_random_string(4);
$request['order_number'] = $out_trade_no; $request['order_number'] = $out_trade_no;

@ -78,7 +78,7 @@ class WapPayController extends BaseController{
if($game['pay_status'] == 0){ if($game['pay_status'] == 0){
$this->set_message(0,"fail","该游戏暂时无法充值,请联系客服!"); $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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find();
if($extend_data){ if($extend_data){
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
@ -498,9 +498,11 @@ class WapPayController extends BaseController{
C(api('Config/lists')); C(api('Config/lists'));
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); if($request['code'] == 1){ // 1正常充值 0平台币充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; 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"; $table = $request['code'] == 1 ? "spend" : "deposit";
@ -574,9 +576,11 @@ class WapPayController extends BaseController{
if($game['pay_status'] == 0){ if($game['pay_status'] == 0){
$this->set_message(0,"fail","该游戏暂时无法充值,请联系客服!"); $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($request['code'] == 1){ // 1正常充值 0平台币充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find();
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); if($extend_data){
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
}
} }
$table = $request['code'] == 1 ? "spend" : "deposit"; $table = $request['code'] == 1 ? "spend" : "deposit";
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; $prefix = $request['code'] == 1 ? "SP_" : "PF_";
@ -887,9 +891,11 @@ class WapPayController extends BaseController{
C(api('Config/lists')); C(api('Config/lists'));
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); if($request['code'] == 1){ // 1正常充值 0平台比充值
if($extend_data){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); if($extend_data){
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
}
} }
$table = $request['code'] == 1 ? "spend" : "deposit"; $table = $request['code'] == 1 ? "spend" : "deposit";

Loading…
Cancel
Save