From 8a14ecfe174e81c8a01681e34dac9503500da704 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 22 Oct 2019 11:55:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=AC=E6=B5=AE=E7=90=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Common/function.php | 10 ++++--- .../Sdk/Controller/GameController.class.php | 26 ++++++++++--------- .../Sdk/Controller/UserController.class.php | 4 +-- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Application/Sdk/Common/function.php b/Application/Sdk/Common/function.php index 5d3a284d..f04ba640 100644 --- a/Application/Sdk/Common/function.php +++ b/Application/Sdk/Common/function.php @@ -240,8 +240,10 @@ function getChinaChar($num) function re_msg($code=200,$msg,$data) { - $data['code'] = $code; - $data['msg'] = $msg; - $data['data'] = $data; - echo base64_encode(json_encode($data));die(); + $ret['code'] = $code; + $ret['msg'] = $msg; + $ret['data'] = $data; + + echo base64_encode(json_encode($ret)); + die(); } diff --git a/Application/Sdk/Controller/GameController.class.php b/Application/Sdk/Controller/GameController.class.php index 952ba5f8..94fde25a 100644 --- a/Application/Sdk/Controller/GameController.class.php +++ b/Application/Sdk/Controller/GameController.class.php @@ -42,12 +42,14 @@ class GameController extends BaseController{ public function get_suspend(){ $data = json_decode(base64_decode(file_get_contents("php://input"),true)); - - $user_token = M('User','tab_')->where(['id' => $data['user_id']])->getField('user_token'); + $data['user_id'] = 1; + if(empty($data['user_id'])) { + re_msg(1004, 'fail', '用户不存在'); + } + $user_token = M('user','tab_')->where(['id' => $data['user_id']])->getField('user_token'); - if(empty($data['user_id']) || empty($user_token)) - { - re_msg(1004,'fail','用户不存在'); + if (!$user_token) { + re_msg(1004, 'fail', '数据有误'); } $sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find(); $menus = json_decode($sdkMenus['config'],true); @@ -55,14 +57,13 @@ class GameController extends BaseController{ foreach($menus as $k => $v) { $menus[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; - $menus[$k]['url'] = $v['icon'] . '/user_token' . $user_token; - unset($menus[$k]['ios_url']); - } - foreach($menus_item as $k => $v) - { - $menus_item[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; - $menus_item[$k]['url'] = $v['icon'] . '/user_token' . $user_token; + $menus[$k]['url'] = $v['url'] . '/user_token/' . $user_token; + if ($menus[$k]['type'] == 1) + $menus[$k]['ios_url'] = "?action=".$menus[$k]['name']; + else + $menus[$k]['ios_url'] = $menus[$k]['url']."?action=push"; } + array_multisort(array_column($menus,'sort'),SORT_ASC,$menus); $ball_status = M('config','sys_')->where(['name' => 'WAP_SUSPEND_SHWO_STATUS'])->getField('value'); @@ -80,6 +81,7 @@ class GameController extends BaseController{ 'menus' => $menus, 'menus_item' => $menus_item, ]; +// pp($data); re_msg(200,'获取成功',$data); } //获取游戏域名 diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index b5b6e144..c3698b94 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -3142,12 +3142,12 @@ class UserController extends BaseController } - public function get_user_money() + /* public function get_user_money() { $data = json_decode(base64_decode(file_get_contents("php://input"),true); $user_info = M('User','tab')->where(['user_token' => $data['user_token']])->find(); $user_play = M('UserPlay','tab')->where(['']) - } + } */ }