master
yulingwei 5 years ago
parent 80597c4894
commit 1119e8faf9

@ -3596,13 +3596,13 @@ class ExportController extends Controller
//TODO:应需求取消玩家表只要user表的fgame有就算注册无需在play表存在
$play_map = false;
if (isset($_REQUEST['game_name'])) {
$map['fgame_name'] = ['like', "{$_REQUEST['game_name']}%"];
$map['fgame_name'] = $_REQUEST['game_name'];
// $play_map = " and up.game_name = '{$_REQUEST['game_name']}' ";
}
$play_info_map = false;
if (isset($_REQUEST['server_id'])) {
$play_map = false; //有区服就不检索玩家表,有区服一定已经选择游戏了
$play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name like '{$_REQUEST['game_name']}%'";
$play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name = '{$_REQUEST['game_name']}'";
}
$today = total(1);
@ -3616,8 +3616,8 @@ class ExportController extends Controller
}
}
if (!empty($_REQUEST['game_type'])) {
$map['tab_game.sdk_version'] = $_REQUEST['game_type'];
if (!empty($_REQUEST['admin_id'])) {
$map['promote.admin_id'] = $_REQUEST['admin_id'];
}
//为数据权限添加
@ -3626,17 +3626,17 @@ class ExportController extends Controller
// 如果是市场专员那么只能看自己的
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$map['tab_promote.admin_id'] = session('user_auth');
$map['promote.admin_id'] = session('user_auth');
}
$data = M("User u","tab_")
->field("count(u.id) as count,tab_game.relation_game_name,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->field("count(u.id) as count,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->join("tab_promote promote ON u.promote_id = promote.id","left")
->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false)
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->join('tab_game on u.fgame_id = tab_game.id')
->where($map)
->group('id, tab_game.relation_game_name')
->group('id')
->order('count desc, register_time')
->select();
//今日/本周/本月不变
@ -3741,9 +3741,9 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname']?$_REQUEST['xlsname']:'推广员注册统计';
$xlsCell = array(
array('company_name' , "公司"),
array('promote_account', "推广员账号"),
array('admin_username' , "管理员"),
array('relation_game_name' , "游戏"),
array('promote_account', "会长账号"),
array('admin_username' , "市场专员"),
//array('relation_game_name' , "游戏"),
array('count' , "累计注册"),
array('rand' , "排行榜"),
array('today' , "今日注册"),

@ -437,13 +437,13 @@ class PlatformController extends ThinkController
//TODO:应需求取消玩家表只要user表的fgame有就算注册无需在play表存在
$play_map = false;
if (isset($_REQUEST['game_name'])) {
$map['fgame_name'] = ['like', "{$_REQUEST['game_name']}%"];
$map['fgame_name'] = $_REQUEST['game_name'];
// $play_map = " and up.game_name = '{$_REQUEST['game_name']}' ";
}
$play_info_map = false;
if (isset($_REQUEST['server_id'])) {
$play_map = false; //有区服就不检索玩家表,有区服一定已经选择游戏了
$play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name like '{$_REQUEST['game_name']}%'";
$play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name = '{$_REQUEST['game_name']}'";
}
if (!empty($_REQUEST['admin_id'])) {
@ -461,10 +461,6 @@ class PlatformController extends ThinkController
}
}
if (!empty($_REQUEST['game_type'])) {
$map['tab_game.sdk_version'] = $_REQUEST['game_type'];
}
//为数据权限添加
setPowerPromoteIds($map, 'u.promote_id');
@ -475,13 +471,13 @@ class PlatformController extends ThinkController
}
$data = M("User u","tab_")
->field("count(u.id) as count,tab_game.relation_game_name,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->field("count(u.id) as count,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->join("tab_promote promote ON u.promote_id = promote.id","left")
->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false)
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->join('tab_game on u.fgame_id = tab_game.id')
->where($map)
->group('id, tab_game.relation_game_name')
->group('id')
->order('count desc, register_time')
->select();
//今日/本周/本月不变
@ -662,37 +658,32 @@ class PlatformController extends ThinkController
}
if (isset($_REQUEST['game_name'])) {
$_REQUEST['game_name'] = "{$_REQUEST['game_name']}";
$map['s.game_name'] = ['like', "{$_REQUEST['game_name']}%"];
$map['s.game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['s.server_id'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
}
if (!empty($_REQUEST['admin_id'])) {
$map['s.market_admin_id'] = $_REQUEST['admin_id'];
}
// 如果是市场专员那么只能看自己的
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$map['s.market_admin_id'] = session('user_auth');
}
if (!empty($_REQUEST['game_type'])) {
$map['s.sdk_version'] = $_REQUEST['game_type'];
}
if (!empty($_REQUEST['admin_id'])) {
$map['s.market_admin_id'] = $_REQUEST['admin_id'];
}
if (isset($_REQUEST['sdk_version'])||isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])) {
if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])) {
$data = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id,g.relation_game_name,
->field('tp1.account as promote_account,tp1.id,
floor(sum(pay_amount)*100) as count')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left')
->join("tab_game as g on g.id = s.game_id", 'left')
->where($map)
->group('tp1.id, g.relation_game_name')
->group('tp1.id')
->order('count desc')
->select();
} else {
@ -708,7 +699,7 @@ class PlatformController extends ThinkController
$tmap['pay_time'] = ['between', array($tmin,$tmonth[1][1])];
}
$tdata = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id,g.relation_game_name,
->field('tp1.account as promote_account,tp1.id,
floor(sum(IF(s.pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(s.pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(s.pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
@ -716,7 +707,7 @@ class PlatformController extends ThinkController
->join("tab_spend as s on tp2.id = s.promote_id", 'left')
->join("tab_game as g on g.id = s.game_id", 'left')
->where($tmap)
->group('tp1.id, g.relation_game_name')
->group('tp1.id')
->select();
$tmdata = [];
foreach($data as $k=>$v){
@ -725,6 +716,7 @@ class PlatformController extends ThinkController
$v['mounth'] = 0;
$tmdata[$v['id']] = $v;
}
//dd($data);
foreach ($tdata as $k => $v) {
$tmdata[$v['id']]['today'] = $v['today'];
@ -741,7 +733,7 @@ class PlatformController extends ThinkController
foreach($tmdata as $k => $v){
$data[] = $v;
}
// dd($data);
//dd($data);
unset($map['tp1.id'], $map['tp2.id']);
unset($map['tp1.chain']);
unset($tmap['tp1.id']);
@ -835,7 +827,6 @@ class PlatformController extends ThinkController
'company_name' => '公司',
"promote_account"=>"推广员账号",
'admin_username' => '管理员',
'relation_game_name' => '游戏',
"count"=>"累计充值",
"rand"=>"排行榜",
"today"=>"今日充值",

@ -53,16 +53,16 @@
</div>
</div>
<div class="input-list input-list-promote search_label_rehab">
<label>推广员账号:</label>
<label>会长账号</label>
<select id="promote_id" name="promote_id" class="select_gallery" style="width:150px;">
<option value="">推广员账号</option>
<option value="">会长账号</option>
<volist name=":get_all_toppromote()" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<label>管理员:</label>
<label>市场专员:</label>
<select id="admin_id" name="admin_id" class="select_gallery" style="width:150px;">
<option value="">全部</option>
<volist name="admin_users" id="vo">
@ -71,20 +71,13 @@
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <if condition="$vo.game_name eq I('game_name')">selected</if> >{$vo.game_name}</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 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" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_id" name="server_id" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
@ -111,8 +104,6 @@
<th >管理员</th>
<th >游戏</th>
<th ><a class="paixu" data-order='count'><if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'count'">累计注册▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'count'"/>累计注册▼
<else />累计注册<img src="__IMG__/up-down.png" width="13px">
@ -167,7 +158,6 @@
</if> -->
</td>
<td>{$data['admin_username']}</td>
<td>{$data['relation_game_name']}</td>
<td ><span class='ljzc' data-value="{$data['id']}"><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>
@ -178,7 +168,7 @@
</volist>
</empty>
<tr class="data_summary">
<td colspan="4"><span>汇总</span></td>
<td colspan="3"><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>---</td>
<td>{$total.sum_today}</td>
@ -299,32 +289,46 @@
});
});
var game_server = "{:I('server_id')}";
$("#game_type").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){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
$("#game_id").change(function(){
$.ajax({
url:"{:U('getSpendServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"'>"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
$("#game_name").change(function(){
$("#game_type").change();
});
}
})
});
var game_id = "{:I('game_name')}";
var game_server = "{:I('server_id')}";
if(game_id){
$.ajax({
url:"{:U('getSpendServer')}",
type:"post",
data:{game_name:game_id},
dataType:'json',
success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
$("#game_name").change();
}
})
}
})
</script>
</block>

@ -54,14 +54,14 @@
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" style="width:150px;">
<option value="">推广员账号</option>
<option value="">会长账号</option>
<volist name=":get_all_toppromote()" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<label>管理员:</label>
<label>市场专员:</label>
<select id="admin_id" name="admin_id" class="select_gallery" style="width:150px;">
<option value="">全部</option>
<volist name="admin_users" id="vo">
@ -70,20 +70,13 @@
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <if condition="$vo.game_name eq I('game_name')">selected</if> >{$vo.game_name}</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 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" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_id" name="server_id" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
@ -121,11 +114,9 @@
<tr>
<th >公司</th>
<th >推广员账号</th>
<th >会长账号</th>
<th >管理员</th>
<th >游戏</th>
<th >市场专员</th>
<th ><a class="paixu" data-order='count'><if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'count'">累计充值▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'count'"/>累计充值▼
@ -174,7 +165,6 @@
<td>{$data['company_name']}</td>
<td >{$data['promote_account']}</td>
<td>{$data['admin_username']}</td>
<td>{$data['relation_game_name']}</td>
<td ><span class='ljcz' data-value="{$data['promote_id']}"><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>
@ -184,7 +174,7 @@
</volist>
</empty>
<tr class="data_summary">
<td colspan="4"><span>汇总</span></td>
<td colspan="3"><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>---</td>
<td>{$total.sum_today}</td>
@ -368,31 +358,48 @@
});
});
var game_server = "{:I('server_id')}";
$("#game_type").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){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
$("#game_id").change(function(){
console.log($("#game_id option:selected").attr('game-id'));
$.ajax({
url:"{:U('getSpendServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"'>"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
$("#game_name").change(function(){
$("#game_type").change();
});
}
})
});
var game_name = "{:I('game_name')}";
var game_server = "{:I('server_id')}";
if(game_name){
console.log({game_name:game_name})
$.ajax({
url:"{:U('getSpendServer')}",
type:"post",
data:{game_name:game_name},
dataType:'json',
success:function(data){
console.log(data)
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
$("#game_name").change();
}
})
}
})
</script>
</block>
</block>
Loading…
Cancel
Save