|
|
|
@ -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;
|
|
|
|
|