修复问题

master
yulingwei 5 years ago
parent d1bc94e438
commit 36b295919a

@ -2994,9 +2994,15 @@ class ExportController extends Controller
$end_time = $end = strtotime($end) + 86400; $end_time = $end = strtotime($end) + 86400;
$map = " 1=1 "; $map = " 1=1 ";
$game_map = "";
if (isset($_REQUEST['game_name'])) { if (isset($_REQUEST['game_name'])) {
$game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id'));
$map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; $map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
$game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play_info as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id ";
if (isset($_REQUEST['server_name'])) $game_map .= " AND upi.server_name = {$_REQUEST['server_name']} ";
$game_map .= ") ";
} }
if (isset($_REQUEST['server_name'])) { if (isset($_REQUEST['server_name'])) {
$map .= " AND server_name = '{$_REQUEST['server_name']}' "; $map .= " AND server_name = '{$_REQUEST['server_name']}' ";
} }
@ -3011,10 +3017,11 @@ class ExportController extends Controller
tab_user u tab_user u
WHERE WHERE
u.register_time BETWEEN {$start_time} u.register_time BETWEEN {$start_time}
AND {$end_time} AND {$end_time} {$game_map}
GROUP BY reg_date GROUP BY reg_date
ORDER BY reg_date asc ORDER BY reg_date asc
"); ");
$result = []; $result = [];
foreach ($users as $index => $item) { foreach ($users as $index => $item) {
$ltv_start = strtotime($item['reg_date']); $ltv_start = strtotime($item['reg_date']);

@ -2,6 +2,8 @@
<block name="css"> <block name="css">
</block> </block>
<block name="body"> <block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script> <script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<div class="cf main-place top_nav_list navtab_list"> <div class="cf main-place top_nav_list navtab_list">
@ -98,7 +100,10 @@
<a class="sch-btn" href="{:U('Export/ltv',array( <a class="sch-btn" href="{:U('Export/ltv',array(
'start'=>I('start',date('Y-m-d',strtotime('-30 day'))), 'start'=>I('start',date('Y-m-d',strtotime('-30 day'))),
'end'=>I('end',date('Y-m-d',strtotime('-1 day'))), 'end'=>I('end',date('Y-m-d',strtotime('-1 day'))),
'xlsname'=>'统计_ltv统计' 'game_name'=>I('game_name'),
'game_type'=>I('game_type'),
'server_name'=>I('server_name'),
'xlsname'=>'统计_ltv统计'
),false)}">导出</a> ),false)}">导出</a>
{$_page|default=''} {$_page|default=''}
</div> </div>

Loading…
Cancel
Save