超级签统计

master
zhanglingsheng 5 years ago
parent f3dd820ca1
commit 09ba38fc79

@ -591,6 +591,12 @@ function getAllGame()
return $list;
}
function getAllIosGame()
{
$list = M("game", 'tab_')->field('relation_game_name as game_name,id')->where(['sdk_version' => 2])->group('relation_game_name')->select();
return $list;
}
/**
* 中间加密 替换字符串的子串
*/

@ -0,0 +1,123 @@
<?php
namespace Admin\Controller;
class SuperStatisticalController extends ThinkController
{
private $super_money = 10;
private $ticketList_url = 'https://app.ipa365.com/Kirin/OpenApi/TicketList';
public function index() {
$params = I('get.');
$startDate = empty($params['timestart']) ? '': $params['timestart'];
$endDate = empty($params['timeend']) ? '' : $params['timeend'];
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
if(!empty($startDate)) {
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['game_id'])) {
$where['game_id'] = $params['game_id'];
}
$map['supersign_token'] = ['NEQ',''];
$supersign_game = M('game', 'tab_')->field('supersign_token')->where($map)->select();
$supersign_token = array_column($supersign_game, 'supersign_token');
$authorization_all_num = 0;
foreach($supersign_token as $k => $v) {
$authorization_all_num += count($this->game_supersign_num($v));
}
$where['pay_status'] = 1;
$data['buy_num'] = M('game_supersign', 'tab_')->where($where)->count();
$data['money_all'] = $data['buy_num'] * $this->super_money;
$data['authorization_all_num'] = $authorization_all_num;
$this->assign('data', $data);
$this->display('index');
}
public function lists() {
$map['supersign_token'] = ['NEQ',''];
$supersign_game = M('game', 'tab_')->field('id,game_name,supersign_token')->where($map)->select();
$data = [];
$count['authorization'] = 0;
$count['pay_num'] = 0;
$count['promote_super_money'] = 0;
$count['official_super_money'] = 0;
foreach($supersign_game as $k => $v) {
$arr['game_name'] = $v['game_name'];
$arr['authorization_num'] = count($this->game_supersign_num($v['supersign_token']));
$count['authorization'] += $arr['authorization_num'];
$game_supersign = M('game_supersign', 'tab_')->field('promote_id')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->where(['game_id' => $v['id'], 'pay_status' => 1])->select();
$arr['pay_game_supersign'] = count($game_supersign);
$count['pay_num'] += $arr['pay_game_supersign'];
$arr['promote_super_money'] = 0;
$arr['official_super_money'] = 0;
foreach($game_supersign as $key => $val) {
if($val['promote_id'] != 0) {
$arr['promote_super_money'] += $this->super_money;
}else {
$arr['official_super_money'] += $this->super_money;
}
}
$count['official_super_money'] += $arr['official_super_money'];
$count['promote_super_money'] += $arr['promote_super_money'];
$data[] = $arr;
}
$this->assign('data', $data);
$this->assign('count', $count);
$this->display('lists');
}
private function game_supersign_num($token) {
$re_data = [];
$arr['token'] = $token;
$arr['limit'] = 2000;
for ($i = 1;$i > 0;$i++) {
if($i != 1) {
$pop = array_pop($data);
$arr['lastid'] = $pop['id'];
}
$curl_re = json_decode(curl_post($this->ticketList_url,$arr),true);
if($curl_re['errno'] == 0) {
$data = $curl_re['data']['list'];
$re_data = array_merge($re_data,$data);
} else {
break;
}
if(count($data) != $arr['limit']) {
break;
}
}
return $re_data;
}
public function superDetail() {
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$row = 10;
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$data = M('game_supersign', 'tab_')->field('tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where(['tab_game_supersign.pay_status' => 1])->page($page,$row)->select();
$count = M('game_supersign', 'tab_')->field('tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where(['tab_game_supersign.pay_status' => 1])->count();
$super_money_all = $count * $this->super_money;
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('data', $data);
$this->assign('super_money', $this->super_money);
$this->assign('super_money_all', $super_money_all);
$this->display('superDetail');
}
}

@ -0,0 +1,424 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">超级签订单</h3>
<p class="description_text">说明:玩家点击游戏内道具购买时生成一条新订单</p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time-end" name="timeend" class="" value="{$endDate}"
placeholder="结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllIosGame()" id="vo">
<option value="{$vo.id}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('SuperStatistical/index','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list zdata_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>已授权游戏总数</th>
<th>超级签被购买数量</th>
<th>超级签金额合计</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="data">
<td colspan="4" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<tr>
<td style="color:blue;"><span id="role" class="table_click table_btn player_table_btn"><span class="table_click_text">{$data['authorization_all_num']}</span></span></td>
<td style="color:blue;"><span id="role1" class="table_click table_btn player_table_btn"><span class="table_click_text">{$data['buy_num']}</span></span></td>
<td style="color:blue;"><span id="superDetail" class="table_click table_btn player_table_btn"><span class="table_click_text">{$data['money_all']}</span></span></td>
</tr>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>21,'xlsname'=>'游戏充值预下单'),I('get.')))}">导出</a>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Spend/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('SuperStatistical/index')}');
$(function () {
$("#role").click(function () {
layer.open({
type: 2,
title: "游戏授权数量余额统计",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['admin.php?s=/SuperStatistical/lists' , 'no']
});
});
$("#role1").click(function () {
layer.open({
type: 2,
title: "游戏授权数量余额统计",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['admin.php?s=/SuperStatistical/lists' , 'no']
});
});
$("#superDetail").click(function () {
layer.open({
type: 2,
title: "超级签购买明细",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: ['admin.php?s=/SuperStatistical/superDetail' , 'no']
});
});
//搜索功能
$("#search").click(function () {
var sdate = Date.parse($('#time-start').val()) / 1000;
var edate = Date.parse($('#time-end').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('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;
});
$(".paixu").click(function () {
var that = $(this);
$data_order = that.attr('data-order');
$order_type = '{$userarpu_order}';
if ($order_type == '' || $order_type == '4') {
$(".sortBy").attr('name', 'data_order');
val = '3,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
} else if ($order_type == '3') {
$(".sortBy").attr('name', 'data_order');
val = '4,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$(".budan").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
$.ajax({
type: 'post',
url: url,
data: {orderNo: data},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
layer.msg(e.msg, {icon: 2});
}
},
});
});
$(".budan2").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
$.ajax({
type: 'post',
url: url,
data: {orderNo: data},
success: function (e) {
if (e.status == 1) {
if (e.msg.length > 30) {
window.open(e.msg);
} else {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
}
} else {
layer.msg(e.msg, {icon: 2});
}
},
});
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down11 .nav-list li").find("a").each(function () {
var that = $(".drop-down11");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down12").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down12 .nav-list li").find("a").each(function () {
var that = $(".drop-down12");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down13").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down13 .nav-list li").find("a").each(function () {
var that = $(".drop-down13");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
//下拉内容框
$(".drop-down2").on('click', function (event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function () {
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#i_list_id').on('keyup', function (event) {
var val = $.trim($(this).val()).toLowerCase();
$('#i_list_idh').val(val);
});
$("#i_list_li").find("a").each(function () {
$(this).click(function () {
var text = $.trim($(this).text()).toLowerCase();
$("#i_list_id").val(text);
$('#i_list_idh').val(text);
})
});
})
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevel')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
var game_server = "{:I('server_name')}";
$("#sdk_version").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#sdk_version 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();
}
})
});
$("#game_name").change(function(){
$("#sdk_version").change();
});
$("#game_name").change();
/**
* 初始化select2单选默认带搜索功能。
*/
//初始化页面加载
$(document).ready(function () {
});
</script>
</block>

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>充值查询列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
</head>
<style>
body {
padding: 0px;
}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 92.5%;">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<!-- 数据列表 -->
<div class="data_list box_mt">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>游戏</th>
<th>已授权游戏数量</th>
<th>超级签被购买数量</th>
<th>推广超级签金额</th>
<th>官方超级签金额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="data" id="vo">
<tr>
<td>{$vo.game_name}</td>
<td>{$vo.authorization_num}</td>
<td>{$vo.pay_game_supersign}</td>
<td>{$vo.promote_super_money}</td>
<td>{$vo.official_super_money}</td>
</tr>
</volist>
<tr>
<td>合计</td>
<td>{$count.authorization}</td>
<td>{$count.pay_num}</td>
<td>{$count.promote_super_money}</td>
<td>{$count.official_super_money}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
</div>
</body>
</html>

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>充值查询列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
</head>
<style>
body {
padding: 0px;
}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 92.5%;">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<!-- 数据列表 -->
<div class="data_list box_mt">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>订单号</th>
<th>游戏账号</th>
<th>所属推广员</th>
<th>设备号</th>
<th>游戏</th>
<th>购买时间</th>
<th>超级签金额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="data" id="vo">
<tr>
<td>{$vo.order_id}</td>
<td>{$vo.account}</td>
<td>{$vo.promote_account}</td>
<td>{$vo.device_number}</td>
<td>{$vo.game_name}</td>
<td>{$vo.pay_time|date='Y-m-d H:i:s',###}</td>
<td>{$super_money}</td>
</tr>
</volist>
<tr>
<td>合计</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>{$super_money_all}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
</div>
</body>
</html>

@ -743,4 +743,6 @@ CREATE TABLE `tab_promote_game_ratio` (
`update_time` int(10) NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`),
INDEX `promote_id`(`promote_id`, `game_id`, `status`) USING BTREE
);
);
-- 超级签统计菜单
INSERT INTO `platform`.`sys_menu`( `title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏统计', 137, 0, 'SuperStatistical/index', 0, '', '财务管理', 0, 1);

Loading…
Cancel
Save