悬浮球接口

master
tpingzhang 5 years ago
parent 3c5ebcfb50
commit 2012771107

@ -248,7 +248,6 @@ function re_msg($code=200,$msg='',$data=[])
$ret['code'] = $code; $ret['code'] = $code;
$ret['msg'] = $msg; $ret['msg'] = $msg;
$ret['data'] = $data; $ret['data'] = $data;
echo base64_encode(json_encode($ret)); echo base64_encode(json_encode($ret));
exit(); exit();
} }

@ -56,7 +56,7 @@ class GameController extends BaseController{
$menus = json_decode($sdkMenus['config'],true); $menus = json_decode($sdkMenus['config'],true);
foreach($menus as $k => $v) { foreach($menus as $k => $v) {
$menus[$k]['icon'] = C('ADMIN_DOMAIN') . $v['icon']; $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) if ($menus[$k]['type'] == 1)
$menus[$k]['ios_url'] = "?action=".$menus[$k]['name']; $menus[$k]['ios_url'] = "?action=".$menus[$k]['name'];
else { // H5 else { // H5
@ -70,7 +70,7 @@ class GameController extends BaseController{
$personalMenu = json_decode($personalMenu, true); $personalMenu = json_decode($personalMenu, true);
foreach($personalMenu as &$v) { foreach($personalMenu as &$v) {
$v['icon'] = C('ADMIN_DOMAIN') . $v['icon']; $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页面 if ($v['type'] == 1) // 1 H5页面
$v['ios_url'] = "?action=".$v['name']; $v['ios_url'] = "?action=".$v['name'];
else { else {

@ -3146,21 +3146,20 @@ class UserController extends BaseController
* 获取用户平台币充值记录绑币余额 * 获取用户平台币充值记录绑币余额
* @return [type] [description] * @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 = json_decode(base64_decode(file_get_contents("php://input"),true));
$data['user_token'] = 1; $data['user_token'] = 'f6ddd0b38dc037293a18f5525d59d4eb';
if(empty($data['user_token'])) if(empty($data['user_token']))
{ {
re_msg(1004,'fail','用户不存在'); re_msg(1004,'fail','用户不存在');
} }
$user_info = M('user','tab_')->where(['user_token' => $data['user_token']])->field('id,account,balance')->find(); $user_info = M('user','tab_')->where(['user_token' => $data['user_token']])->field('id,account,balance')->find();
$user_play = M('user_play','tab_')->alias('user') $user_play = M('user_play','tab_')->alias('user')
->join('tab_game as game on user.game_id = game.id') ->join('tab_game as game on user.game_id = game.id')
->where(['user_id' => $user_info['id']]) ->where(['user_id' => $user_info['id']])
->field('user.game_name,user.bind_balance,game.cover')->select(); ->field('user.game_name,user.bind_balance,game.cover')->select();
foreach($user_play as $k => $v) foreach($user_play as $k => $v)
{ {
$cover = get_cover($v['cover'],'path'); $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']); $deposit[$k]['create_time'] = date('Y-m-d',$v['create_time']);
} }
$this->assign('account',$user_info['account']); $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('deposit',$deposit);
$this->assign('user_play',$user_play); $this->assign('user_play',$user_play);
$this->display('balance'); $this->display('balance');

Loading…
Cancel
Save