超级签统计
parent
f3dd820ca1
commit
09ba38fc79
@ -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,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>
|
Loading…
Reference in New Issue