@ -1225,7 +1225,7 @@ class DownloadController extends BaseController {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
$this->error('添加下载失败');
}
}
$this->success('添加下载成功',U('listsIndex'));
$this->success('添加下载成功,导出数据不包含当天 ',U('listsIndex'));
}
}
public function userRecharge_data_export() {
public function userRecharge_data_export() {
@ -1246,7 +1246,7 @@ class DownloadController extends BaseController {
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24 ;
if(!empty(I('endtime'))) { $endTime = $endTime + 24 * 3600; }
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
@ -2955,8 +2955,7 @@ class DownloadController extends BaseController {
->buildSql();
->buildSql();
$map['_string'] = 'ui.role_id in (' . $subQuery . ')';
$map['_string'] = 'ui.role_id in (' . $subQuery . ')';
}
}
$secondDay = 24*3600 + 1;
$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - $secondDay]];
unset($map['begintime']);
unset($map['begintime']);
unset($map['endtime']);
unset($map['endtime']);
//$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
//$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
@ -2965,7 +2964,7 @@ class DownloadController extends BaseController {
$field = $fieldUC . ',' . $fieldUI;
$field = $fieldUC . ',' . $fieldUI;
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->field($field)
->join('left join tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui. game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->where($map)
->where($map)
->group('uc.role_id,uc.server_id,uc.game_id')
->group('uc.role_id,uc.server_id,uc.game_id')
->buildSql();
->buildSql();
@ -2975,7 +2974,7 @@ class DownloadController extends BaseController {
$total = [];
$total = [];
$total = M('user_play_data_count', 'tab_')->alias('uc')
$total = M('user_play_data_count', 'tab_')->alias('uc')
->field($fieldUC)
->field($fieldUC)
->join('left join tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui. game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->where($map)
->where($map)
->find();
->find();
foreach ($roles as $role) {
foreach ($roles as $role) {