|
|
|
@ -638,30 +638,30 @@ class AppleController extends BaseController{
|
|
|
|
|
$code = $_POST['way'];
|
|
|
|
|
|
|
|
|
|
if (empty($request)) {
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'参数错误')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'参数错误')));exit;
|
|
|
|
|
}
|
|
|
|
|
// 支付验证 是否让支付
|
|
|
|
|
$payCheck = pay_check($request['user_id']);
|
|
|
|
|
if (!$payCheck['code']) {
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=> $payCheck['msg'])));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=> $payCheck['msg'])));exit;
|
|
|
|
|
}
|
|
|
|
|
C(api('Config/lists'));
|
|
|
|
|
$user_info = get_user_entity($request['user_id']);
|
|
|
|
|
if($user_info['lock_status'] == 0 || $user_info['check_status'] == 0){
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'账号被禁用,无法充值,请联系客服!')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'账号被禁用,无法充值,请联系客服!')));exit;
|
|
|
|
|
}
|
|
|
|
|
$game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find();
|
|
|
|
|
if($game['pay_status'] == 0){
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'该游戏暂时无法充值,请联系客服!')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'该游戏暂时无法充值,请联系客服!')));exit;
|
|
|
|
|
}
|
|
|
|
|
if($request['price']*1<=0){
|
|
|
|
|
// $this->set_message(0,"fail","充值金额有误");
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',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;
|
|
|
|
|
redirect(U('Spend/notice_v1',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;
|
|
|
|
@ -699,7 +699,7 @@ class AppleController extends BaseController{
|
|
|
|
|
$data = array('discount'=>$discount,"real_price"=>$real_price,'balance'=>$user_entity['balance']);
|
|
|
|
|
|
|
|
|
|
// $this->set_message(1076,"fail","余额不足");
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'余额不足')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'余额不足')));exit;
|
|
|
|
|
exit();
|
|
|
|
|
}
|
|
|
|
|
//防刷预警
|
|
|
|
@ -735,7 +735,7 @@ class AppleController extends BaseController{
|
|
|
|
|
|
|
|
|
|
if ($user_play_data['bind_balance'] < $request['price']) {
|
|
|
|
|
// $this->set_message(1076,"fail","余额不足");
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'余额不足')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'余额不足')));exit;
|
|
|
|
|
exit();
|
|
|
|
|
}
|
|
|
|
|
#扣除平台币
|
|
|
|
@ -747,7 +747,7 @@ class AppleController extends BaseController{
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
// $this->set_message(1081,"fail","支付方式不明确");
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'支付方式不明确')));exit;
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'支付方式不明确')));exit;
|
|
|
|
|
exit();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|