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

master
tpingzhang 5 years ago
parent e30580791e
commit 464e9f244b

@ -37,10 +37,12 @@ class AppleController extends BaseController{
if (!$payCheck['code']) { if (!$payCheck['code']) {
$this->set_message(1088, "fail", $payCheck['msg']); $this->set_message(1088, "fail", $payCheck['msg']);
} }
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
if($extend_data){ if($extend_data){
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); $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){
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; $prefix = $request['code'] == 1 ? "SP_" : "PF_";
@ -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;
} }
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
if($extend_data){ if($extend_data){
echo json_encode(['code'=>0,'msg'=>'订单号重复,请关闭支付页面重新支付']);exit; 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,11 +388,14 @@ 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;
} }
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
if($extend_data){ if($extend_data){
//$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); //$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['extend'].'订单号重复,请关闭支付页面重新支付')));exit; 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_";
$request['pay_way'] = 3; $request['pay_way'] = 3;
@ -574,10 +580,12 @@ class AppleController extends BaseController{
C(api('Config/lists')); C(api('Config/lists'));
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'game_status'=>1))->find();
if($extend_data){ if($extend_data){
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; 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双乾支付-银联
$request['pay_status'] = 0; $request['pay_status'] = 0;
@ -660,11 +668,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;
} }
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
if($extend_data){ if($extend_data){
// $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); // $this->set_message(1089,"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;
} }
}
$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;
$request['pay_order_number'] = $out_trade_no; $request['pay_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,10 +498,12 @@ class WapPayController extends BaseController{
C(api('Config/lists')); C(api('Config/lists'));
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
if($extend_data){ if($extend_data){
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'])));exit; 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";
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; $prefix = $request['code'] == 1 ? "SP_" : "PF_";
@ -574,10 +576,12 @@ 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){ // 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","订单号重复,请关闭支付页面重新支付");
} }
}
$table = $request['code'] == 1 ? "spend" : "deposit"; $table = $request['code'] == 1 ? "spend" : "deposit";
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; $prefix = $request['code'] == 1 ? "SP_" : "PF_";
$request['pay_order_number'] = $prefix . date('Ymd') . date('His') . sp_random_string(4); $request['pay_order_number'] = $prefix . date('Ymd') . date('His') . sp_random_string(4);
@ -887,10 +891,12 @@ class WapPayController extends BaseController{
C(api('Config/lists')); C(api('Config/lists'));
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(); $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find();
if($extend_data){ if($extend_data){
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); $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_";

Loading…
Cancel
Save