|
|
@ -617,6 +617,10 @@ class ShortcutController extends BaseController{
|
|
|
|
$user_id = $request['user_id'];
|
|
|
|
$user_id = $request['user_id'];
|
|
|
|
$request['code'] = I('request.code');
|
|
|
|
$request['code'] = I('request.code');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$user_id) {
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>'用户id为空,请退出支付界面重新进入']);exit;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$payInfo = M('pay_info', 'tab_')->where([
|
|
|
|
$payInfo = M('pay_info', 'tab_')->where([
|
|
|
|
'user_id' => I('user_id'),
|
|
|
|
'user_id' => I('user_id'),
|
|
|
|
'game_id' => I('game_id'),
|
|
|
|
'game_id' => I('game_id'),
|
|
|
@ -628,20 +632,28 @@ class ShortcutController extends BaseController{
|
|
|
|
$userToken = I('request.user_token');
|
|
|
|
$userToken = I('request.user_token');
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($request)) {
|
|
|
|
if (empty($request)) {
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>'登录数据不能为空', 'user_token' => $userToken)));exit;
|
|
|
|
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>'登录数据不能为空', 'user_token' => $userToken)));
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>'登录数据不能为空']);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 支付验证 是否让支付
|
|
|
|
// 支付验证 是否让支付
|
|
|
|
$payCheck = pay_check($request['user_id']);
|
|
|
|
$payCheck = pay_check($request['user_id']);
|
|
|
|
if (!$payCheck['code']) {
|
|
|
|
if (!$payCheck['code']) {
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>$payCheck['msg'], 'user_token' => $userToken)));exit;
|
|
|
|
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>$payCheck['msg'], 'user_token' => $userToken)));
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>$payCheck['msg']]);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find();
|
|
|
|
$game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find();
|
|
|
|
if($game['pay_status'] == 0){
|
|
|
|
if($game['pay_status'] == 0){
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>'该游戏暂时无法充值,请联系客服!', 'user_token' => $userToken)));exit;
|
|
|
|
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>'该游戏暂时无法充值,请联系客服!', 'user_token' => $userToken)));
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>'该游戏暂时无法充值,请联系客服!']);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($request['price']*1<=0){
|
|
|
|
if($request['price']*1<=0){
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>'充值金额有误', 'user_token' => $userToken)));exit;
|
|
|
|
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>'充值金额有误', 'user_token' => $userToken)));
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>'充值金额有误']);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
C(api('Config/lists'));
|
|
|
|
C(api('Config/lists'));
|
|
|
@ -650,7 +662,9 @@ class ShortcutController extends BaseController{
|
|
|
|
$request['extend'] = I('request.extend');
|
|
|
|
$request['extend'] = I('request.extend');
|
|
|
|
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id']))->find();
|
|
|
|
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id']))->find();
|
|
|
|
if($extend_data){
|
|
|
|
if($extend_data){
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'], 'user_token' => $userToken)));exit;
|
|
|
|
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend'], 'user_token' => $userToken)));
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>$request['game_id'].'订单号重复,请关闭支付页面重新支付'.$request['extend']]);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -660,7 +674,9 @@ class ShortcutController extends BaseController{
|
|
|
|
$discount = $discount['discount'];
|
|
|
|
$discount = $discount['discount'];
|
|
|
|
$pay_amount = $discount * $request['price'] / 10;
|
|
|
|
$pay_amount = $discount * $request['price'] / 10;
|
|
|
|
if ($pay_amount < 0.01) {
|
|
|
|
if ($pay_amount < 0.01) {
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform, 'msg'=>'充值金额有误.'.$pay_amount, 'user_token' => $userToken)));exit;
|
|
|
|
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'is_platform'=> $is_platform, 'msg'=>'充值金额有误.'.$pay_amount, 'user_token' => $userToken)));
|
|
|
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>'充值金额有误.'.$pay_amount]);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!$is_platform) {
|
|
|
|
if (!$is_platform) {
|
|
|
@ -717,6 +733,13 @@ class ShortcutController extends BaseController{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($_REQUEST['sign']) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'success']);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//0 官方 1双乾
|
|
|
|
//0 官方 1双乾
|
|
|
|
if (get_shortcut_pay_type() == 0) {
|
|
|
|
if (get_shortcut_pay_type() == 0) {
|
|
|
|
// 暂时只有双乾
|
|
|
|
// 暂时只有双乾
|
|
|
@ -728,6 +751,7 @@ class ShortcutController extends BaseController{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assign("pay_amount", $request['actual_amount']?$request['actual_amount']:$request['price']);
|
|
|
|
$this->assign("pay_amount", $request['actual_amount']?$request['actual_amount']:$request['price']);
|
|
|
|
$this->assign("user_id", $request['user_id']);
|
|
|
|
$this->assign("user_id", $request['user_id']);
|
|
|
|
$this->assign("game_id", $request['game_id']);
|
|
|
|
$this->assign("game_id", $request['game_id']);
|
|
|
|