master
sunke 5 years ago
parent 1358bfee0a
commit 76e2f87256

@ -2401,6 +2401,9 @@ public function iosDetailExcelInfo($id,$map) {
$accessNum = count($rs)?:0 ; $accessNum = count($rs)?:0 ;
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
if ($pages == 0) {
$pages = 1;
}
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$data = M('promote', 'tab_')->field(['id'])->where($map1) $data = M('promote', 'tab_')->field(['id'])->where($map1)
->limit(($i-1)*$perSize ,$perSize)->select(); ->limit(($i-1)*$perSize ,$perSize)->select();
@ -2429,13 +2432,14 @@ public function iosDetailExcelInfo($id,$map) {
$tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量 $tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量 $companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量 $superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id])->count(); $usersCounts = M('user', 'tab_')->where(['promote_id' => $id, 'device_type'=>2])->count();
$tfpercent = 1; $tfpercent = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100;
if ($iosCount == 0) {
if (intval($usersCounts) == 0) {
$tfpercent = 0; $tfpercent = 0;
} }
$csvData['userscounts'] = intval($usersCounts); $csvData['userscounts'] = intval($usersCounts);
$csvData['ioscount'] = $iosCount; $csvData['ioscount'] = $iosCount;
$csvData['tfcounts'] = intval($tfCounts).'('.$tfpercent.'%)'; $csvData['tfcounts'] = intval($tfCounts).'('.$tfpercent.'%)';
$csvData['supercounts'] = intval($superCounts); $csvData['supercounts'] = intval($superCounts);
$csvData['companycounts'] = intval($companyCounts); $csvData['companycounts'] = intval($companyCounts);
@ -2480,7 +2484,7 @@ public function iosDetailExcelInfo($id,$map) {
$allData['account'] = '汇总'; $allData['account'] = '汇总';
$allData['userscounts'] = $allUsersCounts; $allData['userscounts'] = $allUsersCounts;
$allData['iosycounts'] = $allIosCounts; $allData['iosycounts'] = $allIosCounts;
$allData['tfcounts'] = $allTFCounts; $allData['tfcounts'] = $allTFCounts.'('.(number_format((intval($allTFCounts) / intval($allUsersCounts)),2,'.','') * 100).'%)';
$allData['supercounts'] = $allSuperCounts; $allData['supercounts'] = $allSuperCounts;
$allData['companycounts'] = $allCompanyCounts; $allData['companycounts'] = $allCompanyCounts;

@ -2581,15 +2581,16 @@ class QueryController extends BaseController
$tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量 $tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量 $companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量 $superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量
$listData[$key]['tfcounts'] = intval($tfCounts);
$listData[$key]['tfpercent'] = (intval($tfcounts) / intval($iosCount)) * 100;
if (intval($iosCount) == 0) {
$listData[$key]['tfpercent'] = 0;
}
$listData[$key]['companycounts'] = intval($companyCounts); $listData[$key]['companycounts'] = intval($companyCounts);
$listData[$key]['supercounts'] = intval($superCounts); $listData[$key]['supercounts'] = intval($superCounts);
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id, 'device_type' => 2])->count(); $usersCounts = M('user', 'tab_')->where(['promote_id' => $id, 'device_type' => 2])->count();
$listData[$key]['userscounts'] = intval($usersCounts); $listData[$key]['userscounts'] = intval($usersCounts);
$listData[$key]['tfcounts'] = intval($tfCounts);
$listData[$key]['tfpercent'] = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100;
if (intval($usersCounts) == 0) {
$listData[$key]['tfpercent'] = 0;
}
if($promote['level'] == 1) { if($promote['level'] == 1) {
$listData[$key]['belongs_president'] = $promote['account']; $listData[$key]['belongs_president'] = $promote['account'];
$listData[$key]['belongs_department'] = "无所属部门长"; $listData[$key]['belongs_department'] = "无所属部门长";
@ -2620,7 +2621,11 @@ class QueryController extends BaseController
$listData[$key]['belongs_group'] = $groupAccount; $listData[$key]['belongs_group'] = $groupAccount;
} }
} }
$totalpercent = number_format($allTFCounts/$allUsersCounts,2,'.','') * 100;
if ($allUsersCounts == 0) {
$totalpercent = '0';
}
$this->assign('totalpercent', $totalpercent);
$this->assign('listdata', $listData); $this->assign('listdata', $listData);
$this->assign('totaluserscounts', $allUsersCounts); $this->assign('totaluserscounts', $allUsersCounts);
$this->assign('totaltfcounts', $allTFCounts); $this->assign('totaltfcounts', $allTFCounts);

@ -46,7 +46,7 @@
<th>推广员账号</th> <th>推广员账号</th>
<th>IOS用户总数</th> <th>IOS用户总数</th>
<th>新增IOS用户总数</th> <th>新增IOS用户总数</th>
<th>TF下载次数</th> <th title="TF下载次数/IOS用户总数">TF下载次数</th>
<th>超级签下载次数</th> <th>超级签下载次数</th>
<th>企业签下载次数</th> <th>企业签下载次数</th>
<th>所属会长</th> <th>所属会长</th>
@ -77,7 +77,7 @@
<td>汇总(所有数据)</td> <td>汇总(所有数据)</td>
<td>{$totaluserscounts}</td> <td>{$totaluserscounts}</td>
<td>{$allIosCounts}</td> <td>{$allIosCounts}</td>
<td>{$totaltfcounts}</td> <td>{$totaltfcounts}({$totalpercent}%)</td>
<td>{$totalsupercounts}</td> <td>{$totalsupercounts}</td>
<td>{$totalcompanycounts}</td> <td>{$totalcompanycounts}</td>
<td></td> <td></td>

Loading…
Cancel
Save