get_table_fields("ccustom_service_qq",$request['game_id']); $qq = empty($result)?"":$result; if($request['promote_id']!=0){ $res=M('site_base','tab_')->field('site_qq')->where(['promote_id'=>$request['promote_id']])->find(); if($res['site_qq']){ $data = array( "status"=>200, "ccustom_service_qq"=>$res['site_qq'], ); echo base64_encode(json_encode($data));die; } } $data = array( "status"=>200, "ccustom_service_qq"=>C(APP_QQ), ); echo base64_encode(json_encode($data)); } /** * 获取渠道悬浮球图 * @param int $game_id 游戏ID * @return mixed * 小纯洁 */ public function get_suspend(){ $base = M('site_base','tab_')->field('sites_ball_logo,ball_status')->where(['promote_id'=>$request['promote_id']])->find(); $sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find(); $menus = json_decode($sdkMenus['config'],true); foreach($menus as $k => $v) { $menus[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon']; } array_multisort(array_column($menus,'sort'),SORT_ASC,$menus); $data = [ 'code' => 200, 'msg' => '获取成功', 'data' => [ 'sites_ball_logo' => $base['sites_ball_logo'], 'ball_status' => $base['ball_status'], 'menus' => $menus, ] ]; echo base64_encode(json_encode($data));die; } //获取游戏域名 //yyh 2018 10 23 public function get_game_domain(){ $request = json_decode(base64_decode(file_get_contents("php://input")),true); $game_id = $request['game_id']; $list = M('Game','tab_') ->field('tab_game.id,login_notify_url') ->where(['tab_game.id'=>$game_id]) ->join('tab_game_set on game_id = tab_game.id') ->find(); $login_notify_url = $list['login_notify_url']; if(empty($login_notify_url)){ $url = $_SERVER['HTTP_HOST']; }else{ $arr = parse_url($login_notify_url); $scheme = $arr['scheme']?:'http'; $host = $arr['host']; $url = $host; } $this->new_set_message(200,"成功",['url'=>$url]); } //获取sdk分享链接 public function get_sdk_share_url(){ $request = json_decode(base64_decode(file_get_contents("php://input")),true); $game_id = $request['game_id']; $user_id = $request['user_id']; $user_data = M('User','tab_')->field('account')->find($user_id); if (empty($user_data)) { $this->new_set_message(1001, "用户数据不存在", []); } $param = M('param','tab_')->field('openid,wx_appid,type')->where(['game_id'=>$game_id])->select(); $qqappid = ''; $wxappid = ''; if(is_array($param)) { foreach($param as $k=>$v) { if($v['type']==2) { $wxappid = $v['wx_appid']; }elseif($v['type']==1) { $qqappid = $v['openid']; } } } $logo = get_cover(C('WAP_APP_ICON'),'path'); $pointtype = M('point_type','tab_')->field('title,description')->where(['key'=>'invite_friend'])->find(); $url = 'http://'.$_SERVER['HTTP_HOST'].'/app.php/Share/register/invite_account/'.$user_data['account'].'/game_id/'.$game_id; $title = $pointtype['title']?$pointtype['title']:'邀请好友注册得奖励'; $content = $pointtype['description']?$pointtype['description']:'邀请好友注册可获得积分奖励,还有机会获得平台币奖励哦~'; $logo = $logo?$logo:'/Uploads/Picture/yaoqing.png'; if(strpos($logo,'http')===false){ $logo = 'http://'.$_SERVER['HTTP_HOST'].$logo; } $data = ['url'=>$url,'title'=>$title,'logo'=>$logo,'content'=>$content,'qqAPPid'=>$qqappid,'wxAPPid'=>$wxappid]; $this->new_set_message(200, "success", $data); } }