From 20127711071ae37d07ac039250cb9bdc00bbdbf7 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 22 Oct 2019 15:59:33 +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 | 1 - .../Sdk/Controller/GameController.class.php | 4 ++-- .../Sdk/Controller/UserController.class.php | 15 +++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Application/Sdk/Common/function.php b/Application/Sdk/Common/function.php index 3ba01943..f0b6d1fe 100644 --- a/Application/Sdk/Common/function.php +++ b/Application/Sdk/Common/function.php @@ -248,7 +248,6 @@ function re_msg($code=200,$msg='',$data=[]) $ret['code'] = $code; $ret['msg'] = $msg; $ret['data'] = $data; - echo base64_encode(json_encode($ret)); exit(); } diff --git a/Application/Sdk/Controller/GameController.class.php b/Application/Sdk/Controller/GameController.class.php index f09ec577..5a72e7b6 100644 --- a/Application/Sdk/Controller/GameController.class.php +++ b/Application/Sdk/Controller/GameController.class.php @@ -56,7 +56,7 @@ class GameController extends BaseController{ $menus = json_decode($sdkMenus['config'],true); foreach($menus as $k => $v) { $menus[$k]['icon'] = C('ADMIN_DOMAIN') . $v['icon']; - $menus[$k]['url'] = $v['url'] . '/user_token/' . $user_token; + $menus[$k]['url'] = $_SERVER['HTTP_HOST'].$v['url'] . '/user_token/' . $userToken; if ($menus[$k]['type'] == 1) $menus[$k]['ios_url'] = "?action=".$menus[$k]['name']; else { // H5 @@ -70,7 +70,7 @@ class GameController extends BaseController{ $personalMenu = json_decode($personalMenu, true); foreach($personalMenu as &$v) { $v['icon'] = C('ADMIN_DOMAIN') . $v['icon']; - $v['url'] = $v['url'] . '/user_token/' . $userToken; + $v['url'] = $_SERVER['HTTP_HOST'].$v['url'] . '/user_token/' . $userToken; if ($v['type'] == 1) // 1 H5页面 $v['ios_url'] = "?action=".$v['name']; else { diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index 56f8a31e..a2df4288 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -3146,21 +3146,20 @@ class UserController extends BaseController * 获取用户平台币充值记录绑币余额 * @return [type] [description] */ - public function get_user_money() - { + public function get_user_money() + { $data = json_decode(base64_decode(file_get_contents("php://input"),true)); - $data['user_token'] = 1; + $data['user_token'] = 'f6ddd0b38dc037293a18f5525d59d4eb'; if(empty($data['user_token'])) { re_msg(1004,'fail','用户不存在'); } $user_info = M('user','tab_')->where(['user_token' => $data['user_token']])->field('id,account,balance')->find(); - $user_play = M('user_play','tab_')->alias('user') - ->join('tab_game as game on user.game_id = game.id') - ->where(['user_id' => $user_info['id']]) - ->field('user.game_name,user.bind_balance,game.cover')->select(); + ->join('tab_game as game on user.game_id = game.id') + ->where(['user_id' => $user_info['id']]) + ->field('user.game_name,user.bind_balance,game.cover')->select(); foreach($user_play as $k => $v) { $cover = get_cover($v['cover'],'path'); @@ -3179,7 +3178,7 @@ class UserController extends BaseController $deposit[$k]['create_time'] = date('Y-m-d',$v['create_time']); } $this->assign('account',$user_info['account']); - $this->assign('balance',$user_info['balance']); + $this->assign('balance',$user_info['balance']?:0); $this->assign('deposit',$deposit); $this->assign('user_play',$user_play); $this->display('balance');