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.
74 lines
2.6 KiB
PHP
74 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace Admin\Controller;
|
|
|
|
class BehaviorLogController extends ThinkController
|
|
{
|
|
|
|
public function game()
|
|
{
|
|
$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;
|
|
}
|
|
}
|
|
|
|
$p = $params['p'] ? $params['p'] : 1;
|
|
$row = $params['row'] ? $params['row'] : 10;
|
|
|
|
$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);
|
|
if(empty($promoteIds)) {
|
|
$promoteIds[] = $promoteIds;
|
|
}
|
|
$map['promote_id'] = ['in', $promoteIds];
|
|
}
|
|
}
|
|
$data = M('pay_info', 'tab_')->where($map)->order('id DESC')->page($p, $row)->select();
|
|
$count = M('pay_info', 'tab_')->where($map)->count();
|
|
$page = set_pagination($count, $row);
|
|
if ($page) {
|
|
$this->assign('_page', $page);
|
|
}
|
|
$this->assign('startDate', $startDate);
|
|
$this->assign('endDate', $endDate);
|
|
$this->assign('data', $data);
|
|
$this->display('index');
|
|
}
|
|
|
|
}
|