Merge remote-tracking branch 'origin/dev' into dev

master
liuweiwen 5 years ago
commit 587da83973

@ -77,6 +77,8 @@ class AjaxController extends ThinkController{
$game_map = [];
if ($game_name) {
$game_map['relation_game_name'] = $game_name;
}else {
$this->AjaxReturn([]);
}
if ($sdk_version) {
$map['server_version'] = $game_map['sdk_version'] = $sdk_version;

@ -9,34 +9,27 @@ class BehaviorLogController extends ThinkController
{
$params = I('get.');
$ignoreData = ['p', 'row', 'timestart', 'timeend', 'promote_id'];
$map = [];
// if (isset($params['user_account'])) {
// $map['user_account'] = $params['user_account'];
// }
// if (isset($params['extend'])) {
// $map['extend'] = $params['extend'];
// }
// if (isset($params['game_name'])) {
// $map['game_name'] = $params['game_name'];
// }
// if (isset($params['server_name'])) {
// $map['server_name'] = $params['server_name'];
// }
// if (isset($params['sdk_version'])) {
// $map['sdk_version'] = $params['sdk_version'];
// }
// if (isset($params['user_nickname'])) {
// $map['user_nickname'] = $params['user_nickname'];
// }
// if (isset($params['game_player_id'])) {
// $map['game_player_id'] = $params['game_player_id'];
// }
foreach ($params as $k => $v) {
if (!in_array($k, $ignoreData)) {
$map[$k] = $v;
}
if (isset($params['user_account'])) {
$map['user_account'] = $params['user_account'];
}
if (isset($params['extend'])) {
$map['extend'] = $params['extend'];
}
if (isset($params['game_name'])) {
$game_id = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
$map['game_id'] = $game_id;
}
if (isset($params['server_name'])) {
$map['server_name'] = $params['server_name'];
}
if (isset($params['user_nickname'])) {
$map['user_nickname'] = $params['user_nickname'];
}
if (isset($params['game_player_id'])) {
$map['game_player_id'] = $params['game_player_id'];
}
$p = $params['p'] ? $params['p'] : 1;
$row = $params['row'] ? $params['row'] : 10;
@ -46,16 +39,15 @@ class BehaviorLogController extends ThinkController
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
$map['create_time'] = array('BETWEEN', [$startTime, $endTime]);
if ($promoteId = I('promote_id')) {
if (isset($params['promote_id'])) {
$promoteId = $params['promote_id'];
if ($promoteId == 0) {
$map['promote_id'] = 0;
} else {
$promoteMap['chain'] = ['like', "%/$promoteId/%"];
$promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true);
if(empty($promoteIds)) {
$promoteIds[] = $promoteIds;
}
$map['promote_id'] = ['in', $promoteIds];
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
}
$data = M('pay_info', 'tab_')->where($map)->order('id DESC')->page($p, $row)->select();

@ -52,14 +52,18 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
switch ($id) {
case 1:
// $xlsCell = array(
// array('user_account', "玩家账号"),
// array('game_name', "游戏名称"),
// array('server_name', L('Game_area_clothing')),
// array('role_name', "角色名"),
// array('role_level', "游戏等级"),
// array('play_time', "最后登录时间", 'time_format', '*'),
// array('play_ip', "最后登录ip"),
// );
$xlsCell = array(
array('user_account', "玩家账号"),
array('game_name', "游戏名称"),
array('server_name', L('Game_area_clothing')),
array('role_name', "角色名"),
array('role_level', "游戏等级"),
array('play_time', "最后登录时间", 'time_format', '*'),
array('play_ip', "最后登录ip"),
"创建时间","玩家账号", "游戏名称","游戏区服", L('Game_area_clothing'), "角色ID", "角色名", "游戏等级","所属推广员",
"最后登录时间", '最后登录ip',
);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"];
@ -95,10 +99,53 @@ class ExportController extends Controller
$promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null;
}
}
$xlsData = M('user_play_info', 'tab_')
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = M('user_play_info', 'tab_')
->where($map)
->order('play_time desc')
->select();
->order('play_time desc')
->count();
// $accessNum =$accessNum['count'];
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
$lastId = 0;
for($i = 1; $i <= $pages; $i++) {
$xlsData = M('user_play_info', 'tab_')
->field("create_time,user_account,game_name,server_id,server_name,role_id,role_name,role_level,promote_account,play_time,play_ip")
->where($map)
->limit(($i-1)*$perSize ,$perSize)
->order('play_time desc')
->select();
foreach($xlsData as $value) {
$value['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
$value['play_time'] = date("Y-m-d H:i:s",$value['play_time']);
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
$lastId = $value['id'];
}
unset($xlsData);//释放变量的内存
//刷新输出缓冲到浏览器
ob_flush();
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
fclose($fp);
exit();
break;
case 2:
$xlsName = $xlsName?$xlsName:"渠道注册";
@ -339,10 +386,10 @@ class ExportController extends Controller
$field = 'a.id,a.account,a.promote_account,a.balance,
IFNULL(sum(ss.pay_amount),0) AS recharge_total,a.gold_coin,a.alipay
,a.id as small_count,a.id as vip_level,a.register_type,register_time,a.login_time
,a.register_ip,a.lock_status,a.age_status,a.register_way';
,a.register_ip,a.device_number,a.lock_status,check_status,a.age_status,a.register_way';
$xlsCell = [L('Account_number_ID'),"玩家账号",L('Subordinate_channel'), "账户平台币"
, "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", "注册方式", L('Registration_time'),
"最后登录时间", L('Register_iP'), L('Account_status')];
"最后登录时间", L('Register_iP'), "设备号" ,L('Account_status'), "拉黑状态"];
$map['tab_user.register_type']=['in','1,2'];
$map['tab_user.register_type']=['in','0,1,2,7'];
@ -645,7 +692,9 @@ class ExportController extends Controller
$xlsData[$k]['register_time'] = date('Y-m-d H:i:s',$xlsData[$k]['register_time']);
$xlsData[$k]['login_time'] = date('Y-m-d H:i:s',$xlsData[$k]['login_time']);
$xlsData[$k]['device_number'] = encryption($xlsData[$k]['device_number']);
$xlsData[$k]['lock_status'] = $xlsData[$k]['lock_status']==1?'正常':'锁定';
$xlsData[$k]['check_status'] = $xlsData[$k]['check_status']==1?'正常':'已拉黑';
$xlsData[$k]['register_type'] = $v['register_type'] == 2?'手机号':($v['register_type']==7?'邮箱':'账号');
@ -1753,6 +1802,62 @@ class ExportController extends Controller
$xlsData[$key]['developers'] = get_developers_account($value['developers'],'account');
}
break;
case 21:
$xlsCell = array(
array('extend', 'CP订单号'),
array('create_time', '充值时间'),
array('user_account', '玩家账号'),
array('game_name', '游戏名称'),
array('server_name', '游戏区服'),
array('promote_account', '所属推广员'),
array('game_player_id', '角色ID'),
array('game_player_name', '角色名称'),
array('price', '订单金额'),
);
$params = I('get.');
$map = [];
if (isset($params['user_account'])) {
$map['user_account'] = $params['user_account'];
}
if (isset($params['extend'])) {
$map['extend'] = $params['extend'];
}
if (isset($params['game_name'])) {
$game_id = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
$map['game_id'] = $game_id;
}
if (isset($params['server_name'])) {
$map['server_name'] = $params['server_name'];
}
if (isset($params['user_nickname'])) {
$map['user_nickname'] = $params['user_nickname'];
}
if (isset($params['game_player_id'])) {
$map['game_player_id'] = $params['game_player_id'];
}
$startDate = empty($params['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $params['timestart'];
$endDate = empty($params['timeend']) ? date('Y-m-d') : $params['timeend'];
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
$map['create_time'] = array('BETWEEN', [$startTime, $endTime]);
if ($promoteId = I('promote_id')) {
if ($promoteId == 0) {
$map['promote_id'] = 0;
} else {
$promoteMap['chain'] = ['like', "%/$promoteId/%"];
$promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
}
$xlsData = M('pay_info', 'tab_')->where($map)->order('id DESC')->select();
foreach($xlsData as $k => $v) {
$xlsData[$k]['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
}
break;
default:
$xlsName = $xlsCell = $xlsData = [];
@ -5517,7 +5622,7 @@ if ($key == 'model'){
$map['tab_user.account']=array('like','%'.$_REQUEST['account'].'%');
unset($_REQUEST['account']);
}
$map['register_type'] = array('in','(0,1,2,3,4,5,6,7)');
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');

@ -812,13 +812,21 @@ class MemberController extends ThinkController
$map['server_name'] = $_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
if (isset($_REQUEST['promote_id'])) {
$map['promote_id'] = $_REQUEST['promote_id'];
unset($_REQUEST['promote_id']);
}
// $map['type'] = 1;
// $map['login_time'] = ['exp', 'login_time<>0'];
$extend = array();
$extend['map'] = $map;
$count = M('UserLoginRecord','tab_')->field('user_id')->where($extend['map'])->group('user_id')->select(false);
$sql = "select count(user_id) as count from ({$count})t";
$count = M('UserLoginRecord','tab_')->query($sql);
$this->m_title = '登录记录';
$this->assign('user_count',$count[0]['count']);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/login_record', 'status' => 1])->find());
parent::lists("UserLoginRecord", $p, $extend['map']);

@ -169,7 +169,7 @@
</div>
</div>
<div class="page">
<!-- <a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>7,'xlsname'=>'游戏订单_游戏充值'),I('get.')))}">导出</a> -->
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>21,'xlsname'=>'游戏充值预下单'),I('get.')))}">导出</a>
{$_page|default=''}
</div>

@ -145,7 +145,8 @@
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td>
<td>{$data.user_account}</td>
<?php $gamename=trim(get_game_name($data['game_id'],'id'));?>
<td><notempty name="gamename">{$gamename}<else /><eq name="data.type" value="2">APP登录<else/>平台登录</eq></notempty></td>
<td><notempty name="gamename">{$gamename}
</notempty></td>
<!--<td><notempty name="data.server_name">{$data['server_name']}<else />空</notempty></td>-->
<!--<td>{$data['game_player_name']}</td>-->
<td><empty name='data["login_time"]'>--<else/>{$data.login_time|date='Y-m-d H:i:s',###}</empty> </td>

@ -1194,7 +1194,7 @@ class DownloadController extends BaseController {
empty(I('game_player_name')) || $map['tab_pay_info.game_player_name'] = ['like', '%' . I('game_player_name') . '%'];
empty(I('user_account')) || $map['tab_pay_info.user_account'] = ['like', '%' . I('user_account') . '%'];
empty(I('extend')) || $map['tab_pay_info.extend'] = I('extend');
empty(I('user_id')) || $map['tab_pay_info.user_id'] = I('user_id');
empty(I('user_id')) || $map['tab_pay_info.game_player_id'] = I('user_id');
if (!empty($begTime) && !empty($endTime)) {
$map['tab_pay_info.create_time'] = ['between', [strtotime($begTime), strtotime($endTime) - 1]];
}else if (empty($begTime) && !empty($endTime)) {
@ -1305,7 +1305,7 @@ class DownloadController extends BaseController {
$payStatus = intval(I('pay_status'));
if (in_array($payStatus, array_keys(self::$payStatus))) {
$map['tab_spend.pay_status'] = $payStatus;
$map['tab_spend.pay_status'] = $payStatus + 2;
}
}
$conditions = json_encode($map,TRUE);
@ -1786,7 +1786,6 @@ class DownloadController extends BaseController {
$map[$key] = $value;
}
}
// var_dump($dataname);die();
switch ($dataname) {
case "注册明细数据":
$this->registerExcelInfo($id,$map); //注册明细
@ -1904,7 +1903,7 @@ class DownloadController extends BaseController {
$csvData['game_name'] = $v['game_name'];
$csvData['promote_id'] = $v['promote_id'];
$csvData['server_name'] = $v['server_name'];
$csvData['user_id'] = $v['user_id'];
$csvData['user_id'] = $v['game_player_id'];
$csvData['game_player_name'] = $v['game_player_name'];
$csvData['price'] = $v['price'];
mb_convert_variables('GBK', 'UTF-8', $csvData);
@ -3300,6 +3299,9 @@ class DownloadController extends BaseController {
'付款时间',
);
$model = M('spend','tab_');
if(!empty($map['tab_spend.pay_status'])) {
$map['tab_spend.pay_status'] = $map['tab_spend.pay_status'] -2 ;
}
$data1 = $model
->field('tab_spend.id')
->join('tab_game on tab_spend.game_id = tab_game.id')
@ -3307,7 +3309,6 @@ class DownloadController extends BaseController {
->where($map)
->order('tab_spend.id desc')
->select();
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
@ -3354,13 +3355,13 @@ class DownloadController extends BaseController {
}
foreach ($data as $key1 => $value1) {
$value1['pay_way'] = $this->payWay[$value1['pay_way']];
$value1['pay_time'] = date('Y-m-d H:i:s',$value1['pay_time']);
$value1['p_p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')';
$value1['p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')';
$value1['proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')';
// $value1['user_account'] = substr_replace($value1['user_account'],'************',3,12);
$value1['user_account'] = $this->encryption($value1['user_account']);
$value1['pay_order_number'] = $this->encryption($value1['pay_order_number']);
$value1['pay_time'] = ($value1['pay_status'] == 1) ? date('Y-m-d H:i:s', $value1['pay_time']) : '--';
$value1['pay_status'] = isset(self::$payStatus[$value1['pay_status']]) ? self::$payStatus[$value1['pay_status']] : "未知状态";
$value1['sdk_version'] = getSDKTypeName($value1['sdk_version']);
switch ($value1['level']) {

@ -57,7 +57,7 @@ class PlayersController extends BaseController {
$map['tab_pay_info.extend'] = $extend;
}
if (!empty($userId)) {
$map['tab_pay_info.user_id'] = $userId;
$map['tab_pay_info.game_player_id'] = $userId;
}
if (!empty($begTime) && !empty($endTime)) {
$map['tab_pay_info.create_time'] = ['between', [$begTime, $endTime - 1]];
@ -98,13 +98,13 @@ class PlayersController extends BaseController {
$parameter['level_promote_2'] = $levelPromote[0];
$parameter['level_promote_3'] = $levelPromote[1];
$parameter['level_promote_4'] = $levelPromote[2];
$serverData = $this->getServer($relationGameId, $sdkVersion);
$serverData = $this->getServer(I('relation_game_id'), I('sdk_version'));
$page = set_pagination($count, $row, $parameter);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('listData',$rs);
$this->assign('serverData', $serverData);
$this->assign('serverData', $serverData['data']);
$this->assign('initBegTime', I('begtime'));
$this->assign('initEndTime', I('endtime'));
$this->display();
@ -171,4 +171,10 @@ class PlayersController extends BaseController {
return $result;
}
public function getServerAjax()
{
$serverData = $this->getServer(I('relation_game_id'), I('sdk_version'));
$this->ajaxReturn($serverData);
}
}

@ -174,6 +174,7 @@ class QueryController extends BaseController
break;
}
$list['user_account'] = substr($list['user_account'], 0, 2) . '******' . substr($list['user_account'], 8);
$list['pay_time'] = ($list['pay_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--';
$list['pay_status'] = isset(QueryController::$payStatus[$list['pay_status']]) ? QueryController::$payStatus[$list['pay_status']] : '未知状态';
$list['sdk_version'] = getSDKTypeName($list['sdk_version']);

@ -178,7 +178,7 @@
<td>{$vo.game_name}</td>
<td>{$vo.promote_id}</td>
<td>{$vo.server_name}</td>
<td>{$vo.user_id}</td>
<td>{$vo.game_player_id}</td>
<td>{$vo.game_player_name}</td>
<td>{$vo.price}</td>

@ -216,7 +216,7 @@
<td>{$vo.p_p_pro_account}({$vo.p_p_pro_real_name})</td>
<td>{$vo.p_pro_account}({$vo.p_pro_real_name})</td>
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
<td>{$vo.pay_time|date='Y-m-d H:i:s',###}</td>
<td>{$vo.pay_time}</td>
<!-- <td>-->
<!-- <a href="{:U('Query/viewSpendDetailed',array('id'=>$vo['id']))}" style="cursor: pointer"-->
<!-- class="chakan">查看详细</a>-->

@ -696,5 +696,12 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT '0'
ALTER TABLE `tab_pay_info` ADD COLUMN `game_player_id` varchar(30) DEFAULT '0' COMMENT '玩家游戏内id';
ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMMENT '区别sdk版本1安卓 2苹果 ';
ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号';
ALTER TABLE `tab_pay_info`
MODIFY COLUMN `game_player_id` varchar(255) NULL DEFAULT '0' COMMENT '玩家游戏内id' AFTER `promote_id`;
ALTER TABLE `tab_pay_info`
ADD COLUMN `ip` varchar(255) NOT NULL DEFAULT '0' AFTER `promote_account`,
ADD COLUMN `pay_way` int NOT NULL DEFAULT 0 AFTER `ip`;
-- 菜单(游戏充值预下单)
INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1);

Loading…
Cancel
Save