Merge branch 'feature/fix_work_order' of wmtx/platform into release

修复问题
master
廖金灵 5 years ago committed by Gogs
commit 7ab6c8ad68

@ -1172,7 +1172,7 @@ class StatisticsController extends ThinkController {
if ($endTime = I('create_time_end')) { if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400; $endTime = strtotime($endTime) + 86400;
$pdlMap .= " and pdl.create_time < {$endTime}"; $pdlMap .= " and pdl.create_time < {$endTime}";
$weekMap .= " and register_time < {$endTime}"; $weekMap .= " and register_time <= {$endTime}";
} }
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) { if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
@ -1284,14 +1284,17 @@ class StatisticsController extends ThinkController {
$map['pdl.type'] = I('type'); $map['pdl.type'] = I('type');
} }
$weekMap = '';
if ($startTime = I('create_time_start')) { if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime); $startTime = strtotime($startTime);
$map['_string'] .= " and pdl.create_time >={$startTime}"; $map['_string'] .= " and pdl.create_time >={$startTime}";
$weekMap .= " and register_time >={$startTime}";
} }
if ($endTime = I('create_time_end')) { if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400; $endTime = strtotime($endTime) + 86400;
$map['_string'] .= " and pdl.create_time < {$endTime}"; $map['_string'] .= " and pdl.create_time < {$endTime}";
$weekMap .= " and register_time <= {$endTime}";
} }
$list = M('package_download_log', 'tab_')->alias('pdl') $list = M('package_download_log', 'tab_')->alias('pdl')
@ -1304,12 +1307,26 @@ class StatisticsController extends ThinkController {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y")); $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")); $endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
if (empty($weekMap)) {
$weekMap = " and register_time between $beginThisweek and $endThisweek";
}
$total = M('package_download_log', 'tab_')->alias('pdl') $total = M('package_download_log', 'tab_')->alias('pdl')
->field('count(if(u.device_type=2, 1, null)) as iosCount, count(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') ->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')
->join('tab_promote p on p.id = pdl.promote_id')
//->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map)
->select();
$promoters = M('package_download_log', 'tab_')->alias('pdl')
->field('pdl.promote_id')
->join('tab_promote p on p.id = pdl.promote_id') ->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left') ->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map) ->where($map)
->select(); ->select();
$pids = implode(',', array_unique(array_filter(array_column($promoters, 'promote_id'))));
$total[0]['ioscount'] = $promoters ? M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)")->count() : 0;
$total[0]['weekcount'] = $promoters ? M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)" . $weekMap)->count() : 0;
$count = M('package_download_log', 'tab_')->alias('pdl') $count = M('package_download_log', 'tab_')->alias('pdl')
->join('tab_promote p on p.id = pdl.promote_id') ->join('tab_promote p on p.id = pdl.promote_id')

@ -25,6 +25,46 @@
height:26px;line-height:26px;font-size:12px; height:26px;line-height:26px;font-size:12px;
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.tooltip {
position: relative;
display: inline-block;
color: #056dae;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 250%;
background-color: #fff;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
margin-left: -70%;
border: #000 solid 1px;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
color: #000;
visibility: visible;
line-height: 20px;
}
</style> </style>
<!-- 标题栏 --> <!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list"> <div class="cf main-place top_nav_list navtab_list">
@ -86,7 +126,7 @@
<?php else:?> <?php else:?>
<th>iOS用户总数</th> <th>iOS用户总数</th>
<th>新增iOS用户总数</th> <th>新增iOS用户总数</th>
<th>TF下载数</th> <th><div class="tooltip">TF下载数<span class="tooltiptext"><span style="margin-left: -10px">TF下载数(TF下载数/iOS用户总数)</span></span></div></th>
<?php endif;?> <?php endif;?>
<th>超级签下载数</th> <th>超级签下载数</th>
<th>企业签下载数</th> <th>企业签下载数</th>

@ -118,8 +118,8 @@
<volist name="list_data" id="data"> <volist name="list_data" id="data">
<tr> <tr>
<td>{$data.nickname}</td> <td>{$data.nickname}</td>
<td>{$data.total_create_count}</td> <td><?php echo $data['total_create_count'] ?? 0;?></td>
<td>{$data.total_accepted_count}</td> <td><?php echo $data['total_accepted_count'] ?? 0;?></td>
<td><?php echo $data['total_handle_count'] ?? 0;?></td> <td><?php echo $data['total_handle_count'] ?? 0;?></td>
<td><?php echo $data['total_complete_count'] ?? 0;?></td> <td><?php echo $data['total_complete_count'] ?? 0;?></td>
</tr> </tr>

Loading…
Cancel
Save