diff --git a/.gitignore b/.gitignore index c75ed83be..21e948f89 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ Application/Common/Conf/pay_config.php Application/Sdk/OrderNo/ .idea/ Uploads/ -.vscode \ No newline at end of file +.vscode +vendor/ diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index 239e890ab..ff8b149a1 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -541,4 +541,15 @@ function getPartnerList($id = 0) function getPartnerName($id = 0) { return M('Partner', 'tab_')->where(array('id' => intval($id)))->getField('partner'); -} \ No newline at end of file +} +function getGameByName($game_name=null, $sdk_version=null) +{ + $map = []; + if ($game_name) { + $map['relation_game_name'] = $game_name; + } + if ($sdk_version) { + $map['server_version'] = $sdk_version; + } + return D("Game")->where($map)->select(); +} diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index ad020d72d..e5819d404 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -34,7 +34,11 @@ class AjaxController extends ThinkController{ * @param $game_id */ public function getServer($game_id=""){ - $data = M('server','tab_')->where(['game_id'=>$game_id])->select(); + $map = []; + if (!empty($game_id)) { + $map['game_id'] = $game_id; + } + $data = M('server','tab_')->where($map)->select(); $this->AjaxReturn($data); } @@ -42,7 +46,7 @@ class AjaxController extends ThinkController{ *获取充值游戏区服 * @param game_id */ - public function getSpendServer($game_id="",$type=1){ + public function getSpendServer($game_id="",$type=1, $game_type='', $game_name=''){ if($type==2){ $game = M('Game','tab_')->field('id')->where(['game_name'=>$game_id])->find(); $game_id = $game['id']; @@ -66,7 +70,26 @@ class AjaxController extends ThinkController{ $map['server_name'] = array('neq',''); $data = M('UserPlayInfo','tab_')->field('server_name')->where($map)->group('server_name')->select(); $this->AjaxReturn($data); + } + + public function getGmeServer($game_name="", $sdk_version="") + { + $game_map = []; + if ($game_name) { + $game_map['relation_game_name'] = $game_name; + } + if ($sdk_version) { + $map['server_version'] = $game_map['sdk_version'] = $sdk_version; + } + $game = M("Game", 'tab_')->where($game_map)->getField('id', true); + // 获取版本信息 + $map = []; + if ($game) { + $map['game_id'] = ['in', $game]; + } + $data = M('Server', 'tab_')->field('id, server_name, server_id')->where($map)->select(); + $this->AjaxReturn($data); } /** @@ -132,4 +155,41 @@ class AjaxController extends ThinkController{ { $this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>(new PromoteModel)->getPromotersByLevel($level)]); } + + public function getGameList($type=0, $sdk_type=0) + { + $game = M("game","tab_"); + + if(MODULE_NAME == 'Admin') { + $map['game_status'] = array('in','0,1'); + } else { + $map['game_status'] = 1; + } + + if(!empty($type)){ + /*$map['developers'] = $type == 1? array('EQ',0):array('GT',0);*/ + /* $map['game_status'] = $type == 1? 1:array('in','0,1'); */ + switch($type) { + case 1: + $map['developers'] = array('EQ',0); + break; + case 2: + $map['developers'] = array('EGT',0); + break; + default: + $map['developers'] = array('GT',0); + } + }else{ + $map['apply_status'] = 1; + $map['online_status'] = 1; + + } + if (empty($sdk_type)) { + $lists = $game->field('id,game_name,sdk_version,relation_game_name,icon,relation_game_id,game_status,display_site,dow_num')->where($map)->group('relation_game_name')->order("id asc")->select(); + } else { + $map['sdk_version'] = $sdk_type; + $lists = $game->field('id,game_name,sdk_version,relation_game_name,icon,relation_game_id,game_status,display_site,dow_num')->where($map)->order("id asc")->select(); + } + $this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>$lists]); + } } \ No newline at end of file diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 98f059052..0d316286e 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -13,7 +13,6 @@ class MemberController extends ThinkController */ public function user_info($p = 0) { - $hav = ''; if ($_REQUEST['promote_id'] != '') { if($_REQUEST['promote_id']=='UC'){ @@ -109,6 +108,19 @@ class MemberController extends ThinkController $map['lock_status'] = $_REQUEST['status']; unset($_REQUEST['status']); } + + $game_map = ""; + // if (isset($_REQUEST['game_type'])) { + // $game_map .= " and tab_user_play.sdk_version = {$_REQUEST['game_type']}"; + // } + + if (isset($_REQUEST['game_name'])) { + $game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; + } + $game_play_map = ''; + if (isset($_REQUEST['server_name'])) { + $game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' "; + } if (isset($_REQUEST['viplevel'])) { @@ -164,26 +176,28 @@ class MemberController extends ThinkController $data = $usermodel->table('('.$sql1.') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,(a.deposit_total+IFNULL(sum(ss.pay_amount),0)) as recharge_total,check_status') ->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1') - ->join(isset($_REQUEST['game_id']) ? "tab_user_play as up on up.user_id = a.id and up.game_id = {$_REQUEST['game_id']} " : false) + ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false) + ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false) ->page($page, $row) ->having($havs) ->group('a.id') ->order($order) ->select(); -// var_dump($data);die; + //var_dump($usermodel->getLastSql());die; //计数 $sql = M('user', 'tab_')->field('tab_user.id,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total') ->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1') ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1') - ->join(isset($_REQUEST['game_id']) ? "tab_user_play as up on up.user_id = tab_user.id and up.game_id = {$_REQUEST['game_id']} " : false) + ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false) + ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false) ->where($map) ->group('tab_user.id') ->where($hav) ->having($havs)->select(false); // var_dump($sql);die; - $jcount = M('User','tab_')->field('count(a.id) as count')->table('('.$sql.') as a')->select(); + $jcount = M('User','tab_')->field('count(a.id) as count')->table('('.$sql.') as a')->select(); $count = $jcount[0]['count']; $model = M('Model')->getByName('user'); @@ -336,7 +350,18 @@ class MemberController extends ThinkController $this->display(); - } + } + + public function role_list($p=1, $user_id='', $row=10) + { + $limit = ($p-1)*$row . ", $row"; + $list = M("user_play_info", 'tab_')->where(['user_id'=>$user_id])->limit($limit)->order('play_time desc')->select(); + $count = M("user_play_info", 'tab_')->where(['user_id'=>$user_id])->count(); + $page = set_pagination($count,$row); + if($page) {$this->assign('_page', $page);} + $this->assign('list', $list); + $this->display(); + } /** * 公用账户 @@ -640,9 +665,13 @@ class MemberController extends ThinkController public function login_record($p = 1) { if (isset($_REQUEST['game_name'])) { - $extend['game_name'] = $_REQUEST['game_name']; + $map['game_name'] = ['like', $_REQUEST['game_name']."%"]; unset($_REQUEST['game_name']); } + if (isset($_REQUEST['game_type'])) { + $map['sdk_version'] = $_REQUEST['game_type']; + unset($_REQUEST['game_type']); + } if (isset($_REQUEST['login_ip'])) { $map['login_ip'] = $_REQUEST['login_ip']; unset($_REQUEST['login_ip']); @@ -667,6 +696,10 @@ class MemberController extends ThinkController $map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%'); unset($_REQUEST['account']); } + if (isset($_REQUEST['server_name'])) { + $map['server_name'] = $_REQUEST['server_name']; + unset($_REQUEST['server_name']); + } // $map['type'] = 1; $map['login_time'] = array('neq', 0); $extend = array(); @@ -717,7 +750,7 @@ class MemberController extends ThinkController */ public function lock_status($id, $lock_status) { - $map['id'] = $id; + $map['id'] = ['in', explode(',', $id)]; $res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status]); if ($res) { \Think\Log::actionLog('Member/lock_status','Member',$id); @@ -1082,4 +1115,46 @@ class MemberController extends ThinkController } } + public function device_bans_list($row=10, $type='', $tag='', $p=1) + { + $map = []; + if (!empty($type)) { + $map['type'] = $type; + } + if (!empty($tag)) { + $map['tag'] = $tag; + } + $list = M('device_bans', 'tab_')->where($map)->page($p, $row)->select(); + $count = M('device_bans', 'tab_')->where($map)->count(); + $page = set_pagination($count,$row); + if($page) {$this->assign('_page', $page);} + $this->assign('list_data', $list); + $this->display(); + } + + public function save_device_bans($id='', $type='', $tag='') + { + if (empty($id)) { + if (IS_GET) { + return $this->display('device_bans_edit'); + } else { + $map = []; + if (empty($type) || empty($tag)) { + return $this->error("请填写完整信息"); + } + $map['type'] = $type; + $map['tag'] = $tag; + $item = M('device_bans', 'tab_')->where($map)->find(); + if ($item) { + return $this->error("该禁用已经存在(ID:{$item['id']})"); + } + M('device_bans', 'tab_')->add(['type'=>$type, 'tag'=>$tag, 'create_time'=>time(), 'operator_id'=>is_login()]); + } + + return $this->success("新增成功"); + } else { + M('device_bans', 'tab_')->where(['id'=>$id])->delete(); + return $this->success("解除成功"); + } + } } \ No newline at end of file diff --git a/Application/Admin/Controller/PublicController.class.php b/Application/Admin/Controller/PublicController.class.php index 7254d0541..c69553961 100644 --- a/Application/Admin/Controller/PublicController.class.php +++ b/Application/Admin/Controller/PublicController.class.php @@ -32,7 +32,6 @@ class PublicController extends \Think\Controller $Member = D('Member'); if ($Member->login($uid)) { //登录用户 //TODO:跳转到登录前页面 - $this->success('登录成功!', U('Index/index')); } else { diff --git a/Application/Admin/Controller/RechargeSumController.class.php b/Application/Admin/Controller/RechargeSumController.class.php index 8bd895682..c9cec2d35 100644 --- a/Application/Admin/Controller/RechargeSumController.class.php +++ b/Application/Admin/Controller/RechargeSumController.class.php @@ -35,9 +35,17 @@ class RechargeSumController extends ThinkController{ $rmap['register_time'] = $map['register_time'] = array('BETWEEN',array($startDate,$endDate)); $map['play_time'] = array('BETWEEN',array($startDate,$endDate)); $map['pay_time'] = array('BETWEEN',array($startDate,$endDate)); - if(!empty($_REQUEST['game_id'])){ - $map['game_id'] = $_REQUEST['game_id']; - $rmap['fgame_id'] = $_REQUEST['game_id']; + if(!empty($_REQUEST['game_type'])){ + $map['sdk_version'] = $_REQUEST['game_type']; + $rmap['sdk_version'] = $_REQUEST['game_type']; + } + + if(!empty($_REQUEST['game_name'])){ + $rmap['game_id'] = $map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; + } + + if (!empty($_REQUEST['server_name'])) { + $rmap['server_name'] = $map['server_name'] = $_REQUEST['server_name']; } if($_REQUEST['bindcoin']==1) { @@ -68,7 +76,8 @@ class RechargeSumController extends ThinkController{ } //当天注册人数 - $registerNum = D('User')->where(array_merge($rmap,array('puid'=>0)))->getField("id",true); + $registerNum = D('User')->where(array_merge($rmap,array('puid'=>0)))->join("tab_user_play on tab_user.id = tab_user_play.user_id and tab_user.fgame_id = tab_user_play.game_id")->field("tab_user.id")->select(); + $registerNum = $registerNum ? array_column($registerNum, 'id') : []; //当天活跃人数 $livenNum = D('UserPlay')->where($map)->count("id"); @@ -81,7 +90,8 @@ class RechargeSumController extends ThinkController{ } $map['pay_status'] = 1; - $newAddPay = D('Spend')->where(array_merge($map,array('_string'=>'( small_id = 0 or small_id = user_id)')))->sum('pay_amount'); + $newAddPay = D('Spend')->where(array_merge($map,array('_string'=>'( small_id = 0 or small_id = user_id)')))->sum('pay_amount'); + //当天累计付费 unset($map['user_id']); $accumulated = D('Spend')->where($map)->sum('pay_amount'); diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 688a73315..87b82ec04 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -42,7 +42,7 @@ class SpendController extends ThinkController { if($_REQUEST['game_name']=='全部'){ unset($_REQUEST['game_name']); }else{ - $map['tab_spend.game_name']=$_REQUEST['game_name']; + $map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; unset($_REQUEST['game_name']); } } diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index 7561364c0..ed1365e8d 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -77,10 +77,9 @@ class MemberModel extends Model { 'username' => $user['nickname'], 'last_login_time' => $user['last_login_time'], ); - session('user_auth', $auth); session('user_auth_sign', data_auth_sign($auth)); - + setcookie(session_name(),session_id(),time()+3600); } public function getNickName($uid){ diff --git a/Application/Admin/View/Member/device_bans_edit.html b/Application/Admin/View/Member/device_bans_edit.html new file mode 100644 index 000000000..fcb6e2572 --- /dev/null +++ b/Application/Admin/View/Member/device_bans_edit.html @@ -0,0 +1,36 @@ + + + +
+
新增风控
+
    + +
  • + + +
  • +
  • + +
  • +
  • + +
  • +
+
+ + + +
+ + \ No newline at end of file diff --git a/Application/Admin/View/Member/device_bans_list.html b/Application/Admin/View/Member/device_bans_list.html new file mode 100644 index 000000000..3279cdd11 --- /dev/null +++ b/Application/Admin/View/Member/device_bans_list.html @@ -0,0 +1,221 @@ + + + + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+ +
+ + +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID类型标识操作人操作时间操作
aOh! 暂时还没有内容!
{$data.id}{$data.tag}{:get_admin_nickname($data['operator_id'])}{$data.create_time|date='Y-m-d H:i:s',###} + 解除 +
+
+
+
+ {$_page|default=''} +
+ + + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ' + + '; + + + + + + + + diff --git a/Application/Admin/View/Member/edit.html b/Application/Admin/View/Member/edit.html index 428a0dd92..5041ccaa3 100644 --- a/Application/Admin/View/Member/edit.html +++ b/Application/Admin/View/Member/edit.html @@ -204,7 +204,13 @@ 此处显示该玩家的金币提现记录 - + + 角色信息 + + 点击查看 + 点击查看该用户游戏角色信息 + + 游戏登录记录 @@ -297,6 +303,17 @@ content: [url + 'admin.php?s=/Member/chax/id/' + id + '' , 'no'] }); }); + + $("#role").click(function () { + layer.open({ + type: 2, + title: "【游戏付费记录】列表", + shadeClose: true, + shade: 0.8, + area: ['70%', '80%'], + content: [url + 'admin.php?s=/Member/role_list/user_id/' + id + '' , 'no'] + }); + }); $('#tixian').click(function() { layer.open({ diff --git a/Application/Admin/View/Member/login_record.html b/Application/Admin/View/Member/login_record.html index d02fdd1f7..1a463dfc1 100644 --- a/Application/Admin/View/Member/login_record.html +++ b/Application/Admin/View/Member/login_record.html @@ -58,13 +58,25 @@
- -
+ + +
+ +
+
+ +
@@ -230,6 +242,51 @@ }) }); + var game_name = "{:I('game_name')}"; + $("#game_type").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGameList')}", + type:"get", + data:{sdk_type:$("#game_type option:selected").val()}, + dataType:'json', + success:function(response){ + str = ''; + // $.each(response.data, function(index, item){ + // console.log(item.id); + // str += ''; + // }); + data = response.data; + for (var i in data){ + str += "" + } + $("#game_name").empty(); + $("#game_name").append(str); + $("#game_name").select2(); + $("#game_name").change(); + } + }) + }); + $("#game_type").change(); + + var game_server = "{:I('server_name')}"; + $("#game_name").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGmeServer')}", + type:"post", + data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()}, + dataType:'json', + success:function(data){ + str = ""; + for (var i in data){ + str += "" + } + $("#server_name").empty(); + $("#server_name").append(str); + $("#server_name").select2(); + } + }) + }); + }) diff --git a/Application/Admin/View/Member/role_list.html b/Application/Admin/View/Member/role_list.html new file mode 100644 index 000000000..b53c169e1 --- /dev/null +++ b/Application/Admin/View/Member/role_list.html @@ -0,0 +1,76 @@ + + + + + + + 游戏角色列表|----软件管理平台 + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
玩家账号游戏名称游戏区服角色ID角色名游戏等级所属推广员最后登陆时间最后登陆IP
{$data.user_account}{$data.game_name}{$data.server_name}{$data.role_id}{$data.role_name}{$data.role_level}{$data.promote_account}{$data.play_time|date='Y-m-d H:i:s',###}{$data.play_ip}
+
+
+
+ {$_page} +
+
+ + \ No newline at end of file diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index 6142d4ff6..7668698ab 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -113,13 +113,26 @@
- + + + + +
+
+
+
+ +
+
+ 账号ID 第三方来源 @@ -212,6 +232,7 @@ + {$data.id} {:get_registertype($data['register_type'])} @@ -424,22 +445,70 @@ $(function(){ }); $("#promote_level").change(); }) - function shenhe(){ + var game_name = "{:I('game_name')}"; + $("#game_type").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGameList')}", + type:"get", + data:{sdk_type:$("#game_type option:selected").val()}, + dataType:'json', + success:function(response){ + str = ''; + // $.each(response.data, function(index, item){ + // console.log(item.id); + // str += ''; + // }); + data = response.data; + for (var i in data){ + str += "" + } + $("#game_name").empty(); + $("#game_name").append(str); + $("#game_name").select2(); + $("#game_name").change(); + } + }) + }); + $("#game_type").change(); + + var game_server = "{:I('server_name')}"; + $("#game_name").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGmeServer')}", + type:"post", + data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()}, + dataType:'json', + success:function(data){ + str = ""; + for (var i in data){ + str += "" + } + $("#server_name").empty(); + $("#server_name").append(str); + $("#server_name").select2(); + } + }) + }); + + function shenhe(status){ var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { return $(elem).val(); }).get().join(','); + console.log(text); $.ajax({ cache: true, type: "POST", - url:"{:U('Member/age_check')}", - data:{id:text},// 你的formid + url:"{:U('Member/lock_status')}", + data:{id:text, lock_status:status},// 你的formid async: false, error: function(data) { layer.alert("服务器故障,请稍后重试!",{icon: 2}); }, success: function(data) { - var obj = JSON.parse(data); - layer.alert(obj.info,{icon:obj.status}) + // var obj = JSON.parse(data); + // layer.alert(obj.info,{icon:obj.status}) + layer.alert(data.info,{icon:data.status}) + window.location.reload() } }); } diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index 533dacbdc..2694f3be2 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -84,7 +84,7 @@
--> -
- + + + + +
+
+ + + +
+
+
+ + + + +
+
+ +
+
   
+
+     +