master
jbrazz 5 years ago
parent d4c7727426
commit 48de85a3c3

@ -528,3 +528,14 @@ function getServerType($serverType)
return (($serverType == 1) ? '专服' : '混服');
}
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();
}

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

@ -110,12 +110,16 @@ class MemberController extends ThinkController
}
$game_map = "";
if (isset($_REQUEST['game_type'])) {
$game_map .= " and tab_user_play.sdk_version = {$_REQUEST['game_type']}";
}
// 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_name like '{$_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'])) {
@ -173,6 +177,7 @@ 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($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')
@ -186,12 +191,13 @@ class MemberController extends ThinkController
->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($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');
@ -690,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();

@ -32,7 +32,6 @@ class PublicController extends \Think\Controller
$Member = D('Member');
if ($Member->login($uid)) { //登录用户
//TODO:跳转到登录前页面
$this->success('登录成功!', U('Index/index'));
} else {

@ -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)))->join("tab_user_play on tab_user.id = tab_user_play.user_id")->getField("tab_user.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');

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

@ -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){

@ -72,6 +72,11 @@
</volist> -->
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list">
<input type="text" name="login_ip" class="" placeholder="登录IP" value="{:I('login_ip')}">
</div>
@ -257,11 +262,31 @@
$("#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 = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
})
</script>
</block>

@ -127,6 +127,12 @@
</volist> -->
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<br>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
@ -458,11 +464,31 @@ $(function(){
$("#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 = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#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();

@ -80,6 +80,11 @@
</volist> -->
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
@ -336,10 +341,30 @@ $(function(){
$("#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 = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
})
</script>
</block>

@ -58,13 +58,28 @@
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1">安卓</option>
<option value="2">苹果</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist> -->
</select>
</div>
<!-- <div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
</volist>
</select>
</div>
</div> -->
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
@ -459,27 +474,7 @@
})
$("#game_id").change(function(){
$.ajax({
url:"{:U('Ajax/getSpendServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
var promote_id = "{:I('promote_id')}";
console.log(promote_id);
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevel')}",
@ -504,13 +499,59 @@
});
$("#promote_level").change();
var game_id = "{:I('game_name')}";
var game_server = "{:I('server_name')}";
if(game_id){
// var game_id = "{:I('game_name')}";
// var game_server = "{:I('server_name')}";
// if(game_id){
// $.ajax({
// url:"{:U('Ajax/getSpendServer')}",
// type:"post",
// data:{game_id:game_id,type:2},
// dataType:'json',
// success:function(data){
// str = "<option value=''>请选择区服</option>";
// for (var i in data){
// str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
// }
// $("#server_name").empty();
// $("#server_name").append(str);
// $("#server_name").select2();
// }
// })
// }
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 = '<option value="">游戏名称</option>';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#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/getSpendServer')}",
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{game_id:game_id,type:2},
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
@ -520,10 +561,9 @@
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
}
});
/**

Loading…
Cancel
Save