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.

295 lines
12 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">
4 years ago
<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-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="baseGames" id="game">
<option value="{$game.id}" <if condition="I('game_id') eq $game['id']">selected</if>>{$game.name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="sdk_version" name="device_type" class="reselect select_gallery" style="width: 220px;" >
4 years ago
<option value="">请选择设备类型</option>
<option value="android" <if condition="I('device_type') === 'android'">selected</if>>Andriod</option>
<option value="ios" <if condition="I('device_type') === 'ios'">selected</if>>IOS</option>
</select>
</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/userretention','model='.$model['name'],false)}"
value="查询">
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th class="sort" sort-name="date" class="title-cursor-pointer">日期
<if condition="'date' == 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>游戏名称</th>
<th>渠道名称</th>
<th class="sort" sort-name="register_count" class="title-cursor-pointer">新增玩家
<if condition="'register_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="retention_day1" class="title-cursor-pointer">1日留存
<if condition="'retention_day1' == 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="retention_day2" class="title-cursor-pointer">2日留存
<if condition="'retention_day2' == 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="retention_day3" class="title-cursor-pointer">3日留存
<if condition="'retention_day3' == 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="retention_day4" class="title-cursor-pointer">4日留存
<if condition="'retention_day4' == 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="retention_day5" class="title-cursor-pointer">5日留存
<if condition="'retention_day5' == 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="retention_day6" class="title-cursor-pointer">6日留存
<if condition="'retention_day6' == 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="retention_day7" class="title-cursor-pointer">7日留存
<if condition="'retention_day7' == 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="retention_day15" class="title-cursor-pointer">15日留存
<if condition="'retention_day15' == 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="retention_day30" class="title-cursor-pointer">30日留存
<if condition="'retention_day30' == 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="data">
<tr><td colspan="13" class="text-align: center;height: 45vh;"">
<?= $error ? '<span style="color: #ff0000;">' . $error . '</span>': '<img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>' ?></td>
</tr>
<else />
<volist name="data" id="vo">
<tr>
<td>{$vo.date}</td>
<td>{$vo.game_name}</td>
<td>{$vo.promote_name}</td>
<td>{$vo.register_count}</td>
<?php if ($vo['register_count']>0):?>
<td>{$vo['retention_day1']}%</td>
<td>{$vo['retention_day2']}%</td>
<td>{$vo['retention_day3']}%</td>
<td>{$vo['retention_day4']}%</td>
<td>{$vo['retention_day5']}%</td>
<td>{$vo['retention_day6']}%</td>
<td>{$vo['retention_day7']}%</td>
<td>{$vo['retention_day15']}%</td>
<td>{$vo['retention_day30']}%</td>
<?php else:?>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<?php endif;?>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
4 years ago
<a id="sch-btn" data-href="{:U('download/userretention_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
</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()
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 () {
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>