master
yulingwei 5 years ago
parent 9d6bf8225a
commit c1d03cc526

@ -9036,9 +9036,12 @@ class ExportController extends Controller
}
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$xlsData = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2")
->where($map)
->group('p.id')
->select();
@ -9051,13 +9054,29 @@ class ExportController extends Controller
->group('p.id')
->select();
}
$xlsCell = array(
array('account', PromoteModel::$levelArr[$level]."账号"),
array('lowercount', PromoteModel::$levelArr[$level+1]."数量"),
array('tfcount', 'TF下载数'),
array('supersigncount', "超级签下载数"),
array('signcount', "企业签下载数"),
);
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {
foreach($xlsData as &$item) {
$item['tfcount'] = $item['tfcount'] . "(" . (isset($item['ioscount']) ? round( ($item['tfcount'] / $item['ioscount']) * 100 , 2) : 0) . ")%";
}
$xlsCell = array(
array('account', PromoteModel::$levelArr[$level]."账号"),
array('ioscount', "iOS用户总数"),
array('weekcount', "新增iOS用户总数"),
array('tfcount', 'TF下载数/iOS用户总数'),
array('supersigncount', "超级签下载数"),
array('signcount', "企业签下载数"),
);
} else {
$xlsCell = array(
array('account', PromoteModel::$levelArr[$level]."账号"),
array('lowercount', PromoteModel::$levelArr[$level+1]."数量"),
array('tfcount', 'TF下载数'),
array('supersigncount', "超级签下载数"),
array('signcount', "企业签下载数"),
);
}
$this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);

@ -1173,16 +1173,20 @@ class StatisticsController extends ThinkController {
}
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$list = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2")
->where($map)
->page($p, $row)
->group('p.id')
->select();
$total = M('promote', 'tab_')->alias('p')
->field('count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('count(distinct(u.id)) as iosCount, count(distinct(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2")
->where($map)
->select();
} else {
@ -1263,8 +1267,10 @@ class StatisticsController extends ThinkController {
->page($p, $row)
->select();
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$total = M('package_download_log', 'tab_')->alias('pdl')
->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('count(distinct(if(u.device_type=2, 1, null))) as iosCount, count(distinct(if (u.device_type=2 and u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map)

@ -80,8 +80,14 @@
<input class="check-all" type="checkbox">
</th> -->
<th>{$level_desc}账号</th>
<?php if($level < 4):?>
<th>{$level_low_desc}数量</th>
<th>TF下载数</th>
<?php else:?>
<th>iOS用户总数</th>
<th>新增iOS用户总数</th>
<th>TF下载数</th>
<?php endif;?>
<th>超级签下载数</th>
<th>企业签下载数</th>
<th>操作</th>
@ -96,8 +102,15 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>{$data.account}</td>
<?php if($data['level'] < 4):?>
<td>{$data.lowercount}</td>
<td >{$data.tfcount}</td>
<?php else:?>
<td>{$data.ioscount}</td>
<td>{$data.weekcount}</td>
<td >{$data.tfcount}(<?php echo $data['ioscount'] ? round( ($data['tfcount']/$data['ioscount']) * 100, 2) : 0?>%)</td>
<?php endif;?>
<td>{$data.supersigncount}</td>
<td>{$data.signcount}</td>
<td>
@ -112,8 +125,14 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>汇总</td>
<?php if($level < 4):?>
<td>{$total[0]['lowercount']}</td>
<td >{$total[0]['tfcount']}</td>
<?php else:?>
<td>{$total[0]['ioscount']}</td>
<td>{$total[0]['weekcount']}</td>
<td >{$total[0]['tfcount']}(<?php echo $total[0]['ioscount'] ? round( ($total[0]['tfcount']/$total[0]['ioscount']) * 100, 2) : 0?>%)</td>
<?php endif;?>
<td>{$total[0]['supersigncount']}</td>
<td>{$total[0]['signcount']}</td>
<td>

@ -133,7 +133,7 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>汇总</td>
<td colspan="8" style="text-align: left;">TF下载{$total[0]['tfcount']} 超级签下载:{$total[0]['supersigncount']} 企业签下载:{$total[0]['signcount']}</td>
<td colspan="8" style="text-align: left;">iOS用户总数:{$total[0]['ioscount']}&nbsp;&nbsp;新增iOS用户总数:{$total[0]['weekcount']}&nbsp;&nbsp;TF下载(TF下载/iOS用户总数){$total[0]['tfcount']}(<?php echo $total[0]['ioscount'] ? round( ($total[0]['tfcount']/$total[0]['ioscount']) * 100, 2) : 0?>%) &nbsp;&nbsp;&nbsp;&nbsp;超级签下载:{$total[0]['supersigncount']}&nbsp;&nbsp;企业签下载:{$total[0]['signcount']}</td>
</tr>
</empty>
</tbody>

@ -98,7 +98,7 @@
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="handler_id" name="handler_id" class="select_gallery">
<option value="">单人员选择</option>
<option value="">单人员选择</option>
<?php foreach ($admin_users as $user):?>
<option value="{$user['uid']}" <?php if ($user['uid'] == I('handler_id')):?>selected<?php endif;?> >{$user.nickname}</option>
<?php endforeach;?>

@ -172,7 +172,7 @@
</style>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('WorkOrder/list')}');
highlight_subnav('{:U('WorkOrder/statistics')}');
$(function () {
$(".select_gallery").select2();

Loading…
Cancel
Save