Merge branch 'dev' of 47.111.118.107:wmtx/sdk into dev

master
tping 5 years ago
commit 51e569506e

@ -617,6 +617,10 @@ class ShortcutController extends BaseController{
$user_id = $request['user_id'];
$request['code'] = I('request.code');
if (!$user_id) {
echo json_encode(['code'=>0,'msg'=>'用户id为空请退出支付界面重新进入']);exit;
}
$payInfo = M('pay_info', 'tab_')->where([
'user_id' => I('user_id'),
'game_id' => I('game_id'),
@ -628,20 +632,28 @@ class ShortcutController extends BaseController{
$userToken = I('request.user_token');
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']);
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();
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){
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'));
@ -650,7 +662,9 @@ class ShortcutController extends BaseController{
$request['extend'] = I('request.extend');
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id']))->find();
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'];
$pay_amount = $discount * $request['price'] / 10;
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) {
@ -717,6 +733,13 @@ class ShortcutController extends BaseController{
}
}
if ($_REQUEST['sign']) {
echo json_encode(['code'=>200,'msg'=>'success']);
exit;
}
//0 官方 1双乾
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("user_id", $request['user_id']);
$this->assign("game_id", $request['game_id']);

@ -404,7 +404,33 @@
//sq快捷支付
function sqshorcut(){
var url = payurl;
$.ajax({
type:'post',
dataType:'json',
data:{sign: 1},
url:url,
success:function(result) {
if(result.code==200) {
window.location.href = payurl;
} else {
flag=false;
$(".tipmsg").html(result.msg);
$(".msgdialog").show();
}
},
error:function(){
flag=false;
$(".tipmsg").html("接口请求错误");
$(".msgdialog").show();
}
});
return false;
// window.location.href = payurl;
}
//平台币支付
function platform_pay(){

Loading…
Cancel
Save