From 8fa93eb480defc6c3c32b25d3a3fb9289056ac25 Mon Sep 17 00:00:00 2001 From: tping Date: Wed, 24 Jun 2020 14:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=99=BD=E5=90=8D=E5=8D=95+T?= =?UTF-8?q?F=E5=8C=85=20=20=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/GameController.class.php | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/Application/Sdk/Controller/GameController.class.php b/Application/Sdk/Controller/GameController.class.php index acc2e473..ed5dfe51 100644 --- a/Application/Sdk/Controller/GameController.class.php +++ b/Application/Sdk/Controller/GameController.class.php @@ -160,20 +160,21 @@ class GameController extends BaseController{ $this->get_suspend_1(); return ; } - // if (I('debug') == 1) { - // $data['user_id'] = 1; - // $data['sdk_version'] = 2; - // } // 美国IP 贝塔版 $ip = get_client_ip(); - $isUSIP = ip_is_country($ip); -// $isUSIP = false; -// var_dump($isUSIP); + $isUSIP = ip_is_country($ip); + if(empty($data['user_id'])) { re_msg(1004, 'fail', '用户不存在'); } + // 测试白名单用户一定走内购支付 + $testWhite = M('forbit_ip', 'tab_')->where([ + 'user_id' => $data['user_id'], + 'type' => 2 + ])->find(); + $user = M('user','tab_')->field('account,balance')->where(['id' => $data['user_id']])->find(); $user['user_token'] = $data['user_token']; if (!$user['user_token']) { @@ -213,11 +214,18 @@ class GameController extends BaseController{ // var_dump($isUSIP); //判断是否开启苹果内购,beta包,美国ip,且是否在白名单当中 if (isset($data['app_type']) && $data['app_type'] == 2 && $isUSIP) { - - if ($v['name'] == 'gift' || $v['name'] == 'suppersign') { - unset($menus[$k]); - continue; - } + if ($v['name'] == 'gift' || $v['name'] == 'suppersign') { + unset($menus[$k]); + continue; + } + } + + // 测试白名单用户不显示 + if (isset($data['app_type']) && $data['app_type'] == 2 && $testWhite) { + if ($v['name'] == 'gift' || $v['name'] == 'suppersign') { + unset($menus[$k]); + continue; + } } //测试账号苹果审核 @@ -262,14 +270,14 @@ class GameController extends BaseController{ } if(!empty($v['game_status'])) { $game_status = explode(',', $v['game_status']); - if(in_array($data['game_id'], $game_status)) { - unset($personalMenu[$k]); - continue; - } + if(in_array($data['game_id'], $game_status)) { + unset($personalMenu[$k]); + continue; + } } if(isset($v['status']) && $v['status'] == 0) { unset($personalMenu[$k]); - continue; + continue; } //测试账号苹果审核 $game_user = ['test11', 'test12', 'test13', 'test142', 'test171','test830','test1003','test1002','test170','test169']; @@ -279,18 +287,24 @@ class GameController extends BaseController{ continue; } } + + // 测试白名单用户不显示 + if (isset($data['app_type']) && $data['app_type'] == 2 && $testWhite) { + if ($v['name'] == 'gift' || $v['name'] == 'balance') { + unset($personalMenu[$k]); + continue; + } + } if (isset($data['app_type']) && $data['app_type'] == 2 && $isUSIP) { - if ($v['name'] == 'gift' || $v['name'] == 'balance') { + if ($v['name'] == 'gift' || $v['name'] == 'balance') { unset($personalMenu[$k]); continue; } } //测试账号苹果审核 - $personalMenu[$k]['icon'] = (substr($v['icon'], 0, 7) == "http://" || substr($v['icon'], 0, 8) == "https://" ) ? $v['icon'] : - C('ADMIN_DOMAIN') . $v['icon']; -// die; + $personalMenu[$k]['icon'] = (substr($v['icon'], 0, 7) == "http://" || substr($v['icon'], 0, 8) == "https://" ) ? $v['icon'] : C('ADMIN_DOMAIN') . $v['icon']; if($v['type'] != 3){ if (substr($personalMenu[$k]['url'], 0, 7) == "http://" || substr($personalMenu[$k]['url'], 0, 8) == "https://") { $personalMenu[$k]['url'] = $personalMenu[$k]['url'] . '/user_token/' . $user['user_token']."/game_id/".$data['game_id'].'/sdk_version/'.$data['sdk_version'].'/api_ver/2'; @@ -344,8 +358,6 @@ class GameController extends BaseController{ 'menus' => $menusArr, 'mine_features' => $personalMenuArr, ]; - // if (I('debug') == 1) - // pp(($ret)); re_msg(200,'获取成功',$ret); }