悬浮球接口

master
tpingzhang 5 years ago
parent 83d04c5b00
commit 8a14ecfe17

@ -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();
}

@ -42,12 +42,14 @@ class GameController extends BaseController{
public function get_suspend(){
$data = json_decode(base64_decode(file_get_contents("php://input"),true));
$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');
$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);
}
//获取游戏域名

@ -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([''])
}
} */
}

Loading…
Cancel
Save