|
|
|
@ -5,7 +5,6 @@ namespace Admin\Controller;
|
|
|
|
|
class SuperStatisticalController extends ThinkController
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private $super_money = 10;
|
|
|
|
|
|
|
|
|
|
private $ticketList_url = 'https://app.ipa365.com/Kirin/OpenApi/TicketList';
|
|
|
|
|
|
|
|
|
@ -18,12 +17,14 @@ class SuperStatisticalController extends ThinkController
|
|
|
|
|
if(!empty($startDate)) {
|
|
|
|
|
|
|
|
|
|
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
|
|
|
|
|
$map['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
|
|
|
|
|
}
|
|
|
|
|
if(isset($params['game_id'])) {
|
|
|
|
|
$where['game_id'] = $params['game_id'];
|
|
|
|
|
$map['game_id'] = $params['game_id'];
|
|
|
|
|
}
|
|
|
|
|
$map['supersign_token'] = ['NEQ',''];
|
|
|
|
|
$supersign_game = M('game', 'tab_')->field('supersign_token')->where($map)->select();
|
|
|
|
|
$supersign_game = M('game', 'tab_')->field('id,game_name,supersign_token')->where(['supersign_token' => ['NEQ','']])->select();
|
|
|
|
|
$supersign_token = array_column($supersign_game, 'supersign_token');
|
|
|
|
|
$authorization_all_num = 0;
|
|
|
|
|
foreach($supersign_token as $k => $v) {
|
|
|
|
@ -31,7 +32,8 @@ class SuperStatisticalController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
$where['pay_status'] = 1;
|
|
|
|
|
$data['buy_num'] = M('game_supersign', 'tab_')->where($where)->count();
|
|
|
|
|
$data['money_all'] = $data['buy_num'] * $this->super_money;
|
|
|
|
|
$pay_price = M('game_supersign', 'tab_')->field('sum(pay_price) as pay_price')->where($where)->select();
|
|
|
|
|
$data['money_all'] = $pay_price[0]['pay_price'] == '' ? 0 : $pay_price[0]['pay_price'];
|
|
|
|
|
$data['authorization_all_num'] = $authorization_all_num;
|
|
|
|
|
$this->assign('data', $data);
|
|
|
|
|
$this->display('index');
|
|
|
|
@ -40,8 +42,17 @@ class SuperStatisticalController extends ThinkController
|
|
|
|
|
public function lists($p = 1,$row = 10) {
|
|
|
|
|
$page = $p ? $p : 1;
|
|
|
|
|
$row = $row ? $row : 10;
|
|
|
|
|
$params = I('get.');
|
|
|
|
|
if(isset($params['timestart']) && isset($params['timeend'])) {
|
|
|
|
|
$startTime = strtotime($params['timestart']);
|
|
|
|
|
$endTime = strtotime($params['timeend']) + 86399;
|
|
|
|
|
$map['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
|
|
|
|
|
}
|
|
|
|
|
if(isset($params['game_id'])) {
|
|
|
|
|
$map['tab_game.id'] = $params['game_id'];
|
|
|
|
|
}
|
|
|
|
|
$map['supersign_token'] = ['NEQ',''];
|
|
|
|
|
$supersign_game = M('game', 'tab_')->field('id,game_name,supersign_token')->where($map)->page($page,$row)->select();
|
|
|
|
|
$supersign_game = M('game', 'tab_')->field('tab_game.id,tab_game.game_name,tab_game.supersign_token')->join('tab_game_supersign on tab_game_supersign.game_id = tab_game.id')->where($map)->group('tab_game.id')->page($page,$row)->select();
|
|
|
|
|
$data = [];
|
|
|
|
|
$num['authorization'] = 0;
|
|
|
|
|
$num['pay_num'] = 0;
|
|
|
|
@ -51,7 +62,15 @@ class SuperStatisticalController extends ThinkController
|
|
|
|
|
$arr['game_name'] = $v['game_name'];
|
|
|
|
|
$arr['authorization_num'] = count($this->game_supersign_num($v['supersign_token']));
|
|
|
|
|
$num['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();
|
|
|
|
|
|
|
|
|
|
if(isset($params['timestart']) && isset($params['timeend'])) {
|
|
|
|
|
$startTime = strtotime($params['timestart']);
|
|
|
|
|
$endTime = strtotime($params['timeend']) + 86399;
|
|
|
|
|
$where['pay_time'] = array('BETWEEN', [$startTime, $endTime]);
|
|
|
|
|
}
|
|
|
|
|
$where['game_id'] = $v['id'];
|
|
|
|
|
$where['pay_status'] = 1;
|
|
|
|
|
$game_supersign = M('game_supersign', 'tab_')->field('promote_id,pay_price')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->where($where)->select();
|
|
|
|
|
$arr['pay_game_supersign'] = count($game_supersign);
|
|
|
|
|
$num['pay_num'] += $arr['pay_game_supersign'];
|
|
|
|
|
|
|
|
|
@ -59,16 +78,16 @@ class SuperStatisticalController extends ThinkController
|
|
|
|
|
$arr['official_super_money'] = 0;
|
|
|
|
|
foreach($game_supersign as $key => $val) {
|
|
|
|
|
if($val['promote_id'] != 0) {
|
|
|
|
|
$arr['promote_super_money'] += $this->super_money;
|
|
|
|
|
$arr['promote_super_money'] += $val['pay_price'];
|
|
|
|
|
}else {
|
|
|
|
|
$arr['official_super_money'] += $this->super_money;
|
|
|
|
|
$arr['official_super_money'] += $val['pay_price'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$num['official_super_money'] += $arr['official_super_money'];
|
|
|
|
|
$num['promote_super_money'] += $arr['promote_super_money'];
|
|
|
|
|
$data[] = $arr;
|
|
|
|
|
}
|
|
|
|
|
$count = M('game', 'tab_')->where($map)->count();
|
|
|
|
|
$count = count(M('game', 'tab_')->field('tab_game.id,tab_game.game_name,tab_game.supersign_token')->join('tab_game_supersign on tab_game_supersign.game_id = tab_game.id')->where($map)->group('tab_game.id')->select());
|
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
|
$this->assign('data', $data);
|
|
|
|
@ -121,14 +140,20 @@ class SuperStatisticalController extends ThinkController
|
|
|
|
|
$map['tab_user.promote_id'] = ['in', $promoteIds];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$data = M('game_supersign', 'tab_')->field('tab_game_supersign.id,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($map)->page($page,$row)->order('id DESC')->select();
|
|
|
|
|
if(isset($params['timestart']) && isset($params['timeend'])) {
|
|
|
|
|
$startTime = strtotime($params['timestart']);
|
|
|
|
|
$endTime = strtotime($params['timeend']) + 86399;
|
|
|
|
|
$map['tab_game_supersign.pay_time'] = array('BETWEEN', [$startTime, $endTime]);
|
|
|
|
|
}
|
|
|
|
|
if(isset($params['game_id'])) {
|
|
|
|
|
$map['tab_game_supersign.game_id'] = $params['game_id'];
|
|
|
|
|
}
|
|
|
|
|
$data = M('game_supersign', 'tab_')->field('tab_game_supersign.id,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,tab_game_supersign.pay_price')->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($map)->page($page,$row)->order('id DESC')->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($map)->count();
|
|
|
|
|
$super_money_all = $count * $this->super_money;
|
|
|
|
|
|
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
|
$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');
|
|
|
|
|
}
|
|
|
|
|