You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
8.3 KiB
HTML

<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.3" rel="stylesheet">
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.iconsort {
font-size: 1rem;
}
.normal_table tr .sort {
color: #145ccd;
cursor: pointer;
}
.trunk-search .select-time .txt {
width: 100px;
}
.title-cursor-pointer {
cursor: pointer;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>游戏分区数据汇总</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">游戏分区数据汇总</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game_id" name="game_id" class="reselect select_gallery">
<option game-id="0" value="">请选择游戏</option>
<?php foreach($games as $game):?>
<option game-id="<?=$game['id']?>" value="<?=$game['id']?>" <?php if($game['id'] == I('game_id')):?>selected="selected"<?php endif;?>>
<?=$game['game_name']?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="form-group normal_space">
<span id="server_js">
<select id="server_id" name="server_id" class="reselect select_gallery" data-default="<?=I('server_id', '')?>">
<option server-id="0" value="">请选择区服</option>
<?php foreach($servers as $server):?>
<option server-id="<?=$server['server_id']?>" value="<?=$server['server_id']?>" <?php if($server['server_id'] == I('server_id')):?>selected="selected"<?php endif;?>>
<?=$server['server_name']?>
</option>
<?php endforeach;?>
</select>
</span>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space fr">
<label>起止时间:</label>
<input type="text" class="txt range-date" name="time_range" placeholder="创建时间" value="{$start} 至 {$end}" >
</div>
<div class="form-group normal_space">
<input type="hidden" name="last_sort_name" id="last_sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort_name" id="sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort" id="sort" value="{$sort}">
<input type="submit" class="submit" id='submit' url="{:U('Query/gameData','model='.$model['name'],false)}"
value="查询">
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>游戏名称</th>
<th>区服名称</th>
<th class="sort" sort-name="count" class="title-cursor-pointer">创角数
<if condition="'count' == I('sort_name', '')">
<if condition="1 == $sort">
<i class="iconfont iconsort-down"></i>
<else/>
<i class="iconfont iconsort-up"></i>
</if>
<else/>
<i class="iconfont iconsort"></i>
</if>
</th>
<th class="sort" sort-name="amount" class="title-cursor-pointer">消费金额
<if condition="'amount' == I('sort_name', '')">
<if condition="1 == $sort">
<i class="iconfont iconsort-down"></i>
<else/>
<i class="iconfont iconsort-up"></i>
</if>
<else/>
<i class="iconfont iconsort"></i>
</if>
</th>
</tr>
<empty name="records">
<tr><td colspan="13" class="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else />
<volist name="records" id="vo">
<tr>
<td>{$vo.game_name}</td>
<td>{$vo.server_name}</td>
<td><?=intval($vo['count'])?></td>
<td><?=floatval($vo['amount'])?></td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/gameData_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
$('.select_gallery').select2()
$("#game_id").change(function () {
$.ajax({
url: "{:U('getServers')}",
type: "post",
data: { game_id: $("#game_id option:selected").attr('game-id') },
dataType: 'json',
success: function (result ) {
if (result.status == 1) {
var servers = result.data.servers
var str = "<option value=''>请选择区服</option>"
for (var i in servers){
str += "<option value='"+servers[i].server_id+"'>"+servers[i].server_name+"</option>"
}
$("#server_id").empty()
$("#server_id").append(str)
$("#server_id").select2()
}
}
})
})
$("#server_js").click(function (event) {
var game_id = $("#game_id").val();
if (game_id == 0) {
layer.msg('请先选择游戏');
}
});
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$('.sort').click(function () {
var element = $(this);
var sortName = element.attr('sort-name');
var sort = parseInt($('#sort').val());
sort = (sort === 1) ? 2 : 1;
$('#sort').val(sort);
$('#sort_name').val(sortName);
$('#submit').trigger('click');
});
$('#submit').click(function () {
console.log('ssb')
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
})
</script>
</block>