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

ios下载新增统计
master
廖金灵 5 years ago committed by Gogs
commit 93a6e94075

@ -206,19 +206,15 @@ class DownloadController extends BaseController {
$map['type'] = $type; $map['type'] = $type;
} }
if ($createTime != '') { $nowTime = date('Y-m-d');
$createTimeRow = explode(' 至 ', $createTime); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$createTimeBegin = 0; $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$createTimeEnd = 0; $initEndTime = $nowTime;
if (count($createTimeRow) == 2) { $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $begTime = strtotime($initBegTime);
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59'); $endTime = strtotime($initEndTime);
} else { $endTime += 3600 * 24;
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $map['create_time'] = ['between', [$begTime, $endTime]];
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
$conditions = json_encode($map,TRUE); $conditions = json_encode($map,TRUE);
$addtime = time(); $addtime = time();
$data = [ $data = [
@ -248,6 +244,7 @@ class DownloadController extends BaseController {
public function ios_data_export() { public function ios_data_export() {
$levelPromote = $this->getLevelPromote(); $levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote); $queryPromote = $this->getQueryPromote($levelPromote);
$localId = $queryPromote['id'];
$map = []; $map = [];
if ($queryPromote['level'] == 4) { if ($queryPromote['level'] == 4) {
$map['id'] = $queryPromote['id']; $map['id'] = $queryPromote['id'];
@ -255,20 +252,19 @@ class DownloadController extends BaseController {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
} }
$createTime = I('create_time', ''); $createTime = I('create_time', '');
if ($createTime != '') { $nowTime = date('Y-m-d');
$createTimeRow = explode(' 至 ', $createTime); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$createTimeBegin = 0; $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$createTimeEnd = 0; $initEndTime = $nowTime;
if (count($createTimeRow) == 2) { $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $begTime = strtotime($initBegTime);
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59'); $endTime = strtotime($initEndTime);
} else { $endTime += 3600 * 24;
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $map['create_time'] = ['between', [$begTime, $endTime]];
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
$map['pid'] = PID; $map['pid'] = PID;
if ($localId !== PID) {
$map['localId'] = $localId;
}
$conditions = json_encode($map,TRUE); $conditions = json_encode($map,TRUE);
$addtime = time(); $addtime = time();
$data = [ $data = [
@ -2252,9 +2248,9 @@ public function iosDetailExcelInfo($id,$map) {
} }
if (!empty($map['create_time'])) { if (!empty($map['create_time'])) {
$map1['create_time'] = $map['create_time']; $map1['create_time'] = $map['create_time'];
$tfMap['create_time'] = $map['craete_time']; $tfMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['craete_time']; $superMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['craete_time']; $companyMap['create_time'] = $map['create_time'];
} }
$belongs_president = ''; $belongs_president = '';
@ -2271,8 +2267,10 @@ public function iosDetailExcelInfo($id,$map) {
} }
if (!empty($map['promote_id'])) { if (!empty($map['promote_id'])) {
$promote_id = $map['promote_id']; $promote_id = $map['promote_id'];
$map1['promote_id'] = $map['promote_id'];
} }
$rs = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1)->select(); $rs = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1)->select();
$tfMap['promote_id'] = $promote_id; $tfMap['promote_id'] = $promote_id;
$tfMap['type'] = 2; $tfMap['type'] = 2;
$TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); $TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count();
@ -2343,7 +2341,8 @@ public function iosDetailExcelInfo($id,$map) {
$xlsName ="IOS下载数统计"; $xlsName ="IOS下载数统计";
$xlsCell = array( $xlsCell = array(
'推广员账号', '推广员账号',
'玩家人数', 'IOS用户总数',
'新增IOS用户总数',
'TF下载次数', 'TF下载次数',
'超级签下载次数', '超级签下载次数',
'企业签下载次数', '企业签下载次数',
@ -2357,31 +2356,56 @@ public function iosDetailExcelInfo($id,$map) {
$map1['chain'] = $map['chain']; $map1['chain'] = $map['chain'];
} }
if (!empty($map['create_time'])) { if (!empty($map['create_time'])) {
$map1['create_time'] = $map['create_time']; // $map1['create_time'] = $map['create_time'];
$tfMap['create_time'] = $map['create_time']; $tfMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time']; $companyMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['create_time']; $superMap['create_time'] = $map['create_time'];
$allTFMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
$allSuperMap['create_time'] = $map['create_time'];
// $iosTimeMap['register_time'] = $map['create_time'];
$map10['register_time'] = $map['create_time'];
$alliosMap['register_time'] = $map['create_time'];
$allUserMap['register_time'] = $map['create_time'];
$allTFMap['create_time'] = $map['create_time'];
$allSuperMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
$sunday = strtotime('-1 sunday', $map['create_time'][1][1]) + 24 * 3600;
$m['create_time'] = ['between', [$sunday, $map['create_time'][1][1]]];
$iosTimeMap['register_time'] = $m['create_time'];
$alliosMap['register_time'] = $m['create_time'];
} }
if (!empty($map['id'])) { if (!empty($map['id'])) {
$map1['id'] = $map['id']; $map1['id'] = $map['id'];
$tfMap['create_time'] = $map['craete_time']; $tfMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['craete_time']; $superMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['craete_time']; $companyMap['create_time'] = $map['create_time'];
} }
$rs = M('promote', 'tab_')->field(['id'])->where($map1)->select(); $rs = M('promote', 'tab_')->field(['id'])->where($map1)->select();
$allids = array_column($rs, 'id'); $allids = array_column($rs, 'id');
if (!empty($map['localId'])) {
array_push($allids, $map['localId']);
}
array_push($allids, PID); array_push($allids, PID);
$allUserMap['promote_id'] = ['in', $allids]; $allUserMap['promote_id'] = ['in', $allids];
$allUserMap['device_type'] = 2;
$allTFMap['promote_id'] = ['in', $allids]; $allTFMap['promote_id'] = ['in', $allids];
$allTFMap['type'] = 2; $allTFMap['type'] = 2;
$allSuperMap['promote_id'] = ['in', $allids]; $allSuperMap['promote_id'] = ['in', $allids];
$allSuperMap['type'] = 3; $allSuperMap['type'] = 3;
$companyMap['promote_id'] = ['in', $allids]; $companyMap['promote_id'] = ['in', $allids];
$companyMap['type'] = 1; $companyMap['type'] = 1;
$allUsersCounts = M('user', 'tab_')->where($allUserMap)->count(); $allUsersCounts = M('user', 'tab_')->where($allUserMap)->count();
$allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count(); $allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count();
$allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count(); $allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count();
$allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); $allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
$alliosMap['promote_id'] = ['in', $allids];
$alliosMap['device_type'] = 2;
$allIosCounts = M('user', 'tab_')->where($alliosMap)->count();
$csvFileName = $xlsName.'.csv'; $csvFileName = $xlsName.'.csv';
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel'); header('Content-Type: application/vnd.ms-excel');
@ -2395,24 +2419,33 @@ 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();
$ids = array_column($data, 'id'); $ids = array_column($data, 'id');
if ($i == 1) { if ($i == 1) {
if (!empty($map['localId'])) {
array_unshift($ids,$map['localId'] );
}
array_unshift($ids, PID); array_unshift($ids, PID);
} }
foreach($ids as $key => $id) { foreach($ids as $key => $id) {
$promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select(); $promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select();
$promote = $promote1[0]; $promote = $promote1[0];
$chain = $promote['chain']; $chain = $promote['chain'];
//$csvData['promote_id'] = $id;
if($id == PID) { if($id == PID) {
$csvData['account'] = $promote['account'].'[自己]'; $csvData['account'] = $promote['account'].'[自己]';
}else { }else {
$csvData['account'] = $promote['account']; $csvData['account'] = $promote['account'];
} }
$iosTimeMap['promote_id'] = $id;
$iosTimeMap['device_type'] = 2;
$iosCount = M('user', 'tab_')->where($iosTimeMap)->count();
$tfMap['promote_id'] = $id; $tfMap['promote_id'] = $id;
$tfMap['type'] = 2; $tfMap['type'] = 2;
$companyMap['promote_id'] = $id; $companyMap['promote_id'] = $id;
@ -2422,9 +2455,17 @@ 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(); $map10['promote_id'] = $id;
$map10['device_type'] = 2;
$usersCounts = M('user', 'tab_')->where($map10)->count();
$tfpercent = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100;
if (intval($usersCounts) == 0) {
$tfpercent = 0;
}
$csvData['userscounts'] = intval($usersCounts); $csvData['userscounts'] = intval($usersCounts);
$csvData['tfcounts'] = intval($tfCounts); $csvData['ioscount'] = $iosCount;
$csvData['tfcounts'] = intval($tfCounts).'('.$tfpercent.'%)';
$csvData['supercounts'] = intval($superCounts); $csvData['supercounts'] = intval($superCounts);
$csvData['companycounts'] = intval($companyCounts); $csvData['companycounts'] = intval($companyCounts);
@ -2435,7 +2476,7 @@ public function iosDetailExcelInfo($id,$map) {
} }
if ($promote['level'] == 2) { if ($promote['level'] == 2) {
$parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select(); $parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select();
$csvData['belongs_president'] = $parentPromote['account']; $csvData['belongs_president'] = $parentPromote[0]['account'];
$csvData['belongs_department'] = $promote['account']; $csvData['belongs_department'] = $promote['account'];
$csvData['belongs_group'] = "无所属组长"; $csvData['belongs_group'] = "无所属组长";
} }
@ -2467,7 +2508,8 @@ public function iosDetailExcelInfo($id,$map) {
} }
$allData['account'] = '汇总'; $allData['account'] = '汇总';
$allData['userscounts'] = $allUsersCounts; $allData['userscounts'] = $allUsersCounts;
$allData['tfcounts'] = $allTFCounts; $allData['iosycounts'] = $allIosCounts;
$allData['tfcounts'] = $allTFCounts.'('.(number_format((intval($allTFCounts) / intval($allUsersCounts)),2,'.','') * 100).'%)';
$allData['supercounts'] = $allSuperCounts; $allData['supercounts'] = $allSuperCounts;
$allData['companycounts'] = $allCompanyCounts; $allData['companycounts'] = $allCompanyCounts;

@ -2491,46 +2491,53 @@ class QueryController extends BaseController
} }
public function iosDownLoadData() { public function iosDownLoadData() {
$page = intval(I('get.p', 1)); $page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage $page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10)); $row = intval(I('get.row', 10));
$levelPromote = $this->getLevelPromote(); $levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote); $queryPromote = $this->getQueryPromote($levelPromote);
$localId = $queryPromote['id'];
$loginPromote = $this->getLoginPromote(); $loginPromote = $this->getLoginPromote();
$map = []; $map = [];
if ($queryPromote['level'] == 4) { if ($queryPromote['level'] == 4) {
$map['id'] = $queryPromote['id']; $map['id'] = $queryPromote['id'];
}else { }else {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '%'];
} }
$createTime = I('create_time', ''); $iostime = time();
if ($createTime != '') { $sunday = strtotime('-1 sunday', $iostime) + 24 * 3600;
$createTimeRow = explode(' 至 ', $createTime); if (I('begtime') && I('endtime')) {
$createTimeBegin = 0; $iostime = strtotime(I('endtime'));
$createTimeEnd = 0;
if (count($createTimeRow) == 2) {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59');
} else {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$tfMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$companyMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$superMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
} }
$iosTimeMap['register_time'] = ['between', [$sunday, $iostime]];
$createTime = I('create_time', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$tfMap['create_time'] = ['between', [$begTime, $endTime]];
$companyMap['create_time'] = ['between', [$begTime, $endTime]];
$superMap['create_time'] = ['between', [$begTime, $endTime]];
$map10['register_time'] = ['between', [$begTime, $endTime]];
//var_dump($map);die();
$query = M('promote', 'tab_')->field(['id'])->where($map); $query = M('promote', 'tab_')->field(['id'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query); list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id'); $ids = array_column($promotes, 'id');
if ($localId !== PID) {
array_push($ids, $localId);
}
if ($page == 1) { if ($page == 1) {
array_push($ids, PID); array_push($ids, PID);
} }
// var_dump($ids);die();
// $ids = M('promote', 'tab_')->where($map)->getField('id', true);
// $ids[] = $queryPromote['id'];
$allPromote = M('promote', 'tab_')->field(['id'])->where($map)->select(); $allPromote = M('promote', 'tab_')->field(['id'])->where($map)->select();
$allids = array_column($allPromote, 'id'); $allids = array_column($allPromote, 'id');
if ($localId !== PID) {
array_push($allids, $localId);
}
array_push($allids, PID); array_push($allids, PID);
$map = []; $map = [];
$map['tab_package_download_log.promote_id'] = ['in', $ids]; $map['tab_package_download_log.promote_id'] = ['in', $ids];
@ -2538,13 +2545,23 @@ class QueryController extends BaseController
// $data = M('package_download_log','tab_')->where($map)->select(); // $data = M('package_download_log','tab_')->where($map)->select();
$listData = []; $listData = [];
$allUserMap['promote_id'] = ['in', $allids]; $allUserMap['promote_id'] = ['in', $allids];
$allUserMap['device_type'] = 2;
$allUserMap['register_time'] = ['between', [$begTime, $endTime]];
$allTFMap['promote_id'] = ['in', $allids]; $allTFMap['promote_id'] = ['in', $allids];
$allTFMap['type'] = 2; $allTFMap['type'] = 2;
$allTFMap['create_time'] = ['between', [$begTime, $endTime]];
$allSuperMap['promote_id'] = ['in', $allids]; $allSuperMap['promote_id'] = ['in', $allids];
$allSuperMap['type'] = 3; $allSuperMap['type'] = 3;
$allSuperMap['create_time'] = ['between', [$begTime, $endTime]];
$companyMap['promote_id'] = ['in', $allids]; $companyMap['promote_id'] = ['in', $allids];
$companyMap['type'] = 1; $companyMap['type'] = 1;
$companyMap['create_time'] = ['between', [$begTime, $endTime]];
$alliosMap['promote_id'] = ['in', $allids];
$alliosMap['device_type'] = 2;
$alliosMap['register_time'] = ['between', [$sunday, $iostime]];
$allUsersCounts = M('user', 'tab_')->where($allUserMap)->count(); $allUsersCounts = M('user', 'tab_')->where($allUserMap)->count();
$allIosCounts = M('user', 'tab_')->where($alliosMap)->count();
$allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count(); $allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count();
$allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count(); $allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count();
$allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); $allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
@ -2559,6 +2576,10 @@ class QueryController extends BaseController
}else { }else {
$listData[$key]['account'] = $promote['account']; $listData[$key]['account'] = $promote['account'];
} }
$iosTimeMap['promote_id'] = $id;
$iosTimeMap['device_type'] = 2;
$iosCount = M('user', 'tab_')->where($iosTimeMap)->count();
$listData[$key]['ioscount'] = $iosCount;
$tfMap['promote_id'] = $id; $tfMap['promote_id'] = $id;
$tfMap['type'] = 2; $tfMap['type'] = 2;
$companyMap['promote_id'] = $id; $companyMap['promote_id'] = $id;
@ -2568,11 +2589,18 @@ 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]['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])->count(); $map10['promote_id'] = $id;
$map10['device_type'] = 2;
$usersCounts = M('user', 'tab_')->where($map10)->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'] = "无所属部门长";
@ -2580,7 +2608,7 @@ class QueryController extends BaseController
} }
if ($promote['level'] == 2) { if ($promote['level'] == 2) {
$parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select(); $parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select();
$listData[$key]['belongs_president'] = $parentPromote['account']; $listData[$key]['belongs_president'] = $parentPromote[0]['account'];
$listData[$key]['belongs_department'] = $promote['account']; $listData[$key]['belongs_department'] = $promote['account'];
$listData[$key]['belongs_group'] = "无所属组长"; $listData[$key]['belongs_group'] = "无所属组长";
} }
@ -2603,13 +2631,21 @@ 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);
$this->assign('totalsupercounts', $allSuperCounts); $this->assign('totalsupercounts', $allSuperCounts);
$this->assign('pagination', $pagination); $this->assign('pagination', $pagination);
$this->assign('totalcompanycounts', $allCompanyCounts); $this->assign('totalcompanycounts', $allCompanyCounts);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('allIosCounts', $allIosCounts);
$this->assign('tfpercent', $tfpercent);
$this->display(); $this->display();
} }
@ -2618,23 +2654,22 @@ class QueryController extends BaseController
$belongs_president = $_REQUEST['belongs_president']; $belongs_president = $_REQUEST['belongs_president'];
$belongs_department = $_REQUEST['belongs_department']; $belongs_department = $_REQUEST['belongs_department'];
$belongs_group = $_REQUEST['belongs_group']; $belongs_group = $_REQUEST['belongs_group'];
$createTime = I('create_time', ''); // $createTime = I('create_time', '');
if ($createTime != '') {
$createTimeRow = explode(' 至 ', $createTime); $nowTime = date('Y-m-d');
$createTimeBegin = 0; $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$createTimeEnd = 0; $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
if (count($createTimeRow) == 2) { $initEndTime = $nowTime;
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59'); $begTime = strtotime($initBegTime);
} else { $endTime = strtotime($initEndTime);
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $endTime += 3600 * 24;
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
} $map['create_time'] = ['between', [$begTime, $endTime]];
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]]; $tfMap['create_time'] = ['between', [$begTime, $endTime]];
$tfMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]]; $superMap['create_time'] = ['between', [$begTime, $endTime]];
$superMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]]; $companyMap['create_time'] = ['between', [$begTime, $endTime]];
$companyMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
if(!empty(I('user_account'))) { if(!empty(I('user_account'))) {
$user_id = M('user', 'tab_')->where(['account'=>I('user_account')])->getField('id'); $user_id = M('user', 'tab_')->where(['account'=>I('user_account')])->getField('id');
$map['user_id'] = $user_id; $map['user_id'] = $user_id;
@ -2692,6 +2727,8 @@ class QueryController extends BaseController
$this->assign('belongs_group', $belongs_group); $this->assign('belongs_group', $belongs_group);
$this->assign('pagination', $pagination); $this->assign('pagination', $pagination);
$this->assign('datas', $packAges); $this->assign('datas', $packAges);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->display(); $this->display();
} }
} }

@ -10,6 +10,9 @@
line-height: 34px; line-height: 34px;
height: 34px; height: 34px;
} }
.pointer-hand {
cursor: pointer;
}
</style> </style>
</block> </block>
<block name="body"> <block name="body">
@ -25,9 +28,15 @@
<div class="trunk-content article"> <div class="trunk-content article">
<div class="trunk-search clearfix jssearch"> <div class="trunk-search clearfix jssearch">
<include file="Public/promote_select" /> <include file="Public/promote_select" />
<div class="form-group normal_space fr"> <div class="form-group normal_space fr" style="display: flex;">
<label>创建时间:</label> <label class="form-title select-title" style="position: relative;">创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" > <div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div> </div>
<div class="form-group normal_space"> <div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadData','model='.$model['name'],false)}" <input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadData','model='.$model['name'],false)}"
@ -38,8 +47,9 @@
<table class="table normal_table"> <table class="table normal_table">
<tr class="odd"> <tr class="odd">
<th>推广员账号</th> <th>推广员账号</th>
<th>玩家人数</th> <th>IOS用户总数</th>
<th>TF下载次数</th> <th>新增IOS用户总数</th>
<th class="pointer-hand" title="TF下载次数/IOS用户总数">TF下载次数</th>
<th>超级签下载次数</th> <th>超级签下载次数</th>
<th>企业签下载次数</th> <th>企业签下载次数</th>
<th>所属会长</th> <th>所属会长</th>
@ -54,7 +64,8 @@
<tr> <tr>
<td>{$data.account}</td> <td>{$data.account}</td>
<td>{$data.userscounts}</td> <td>{$data.userscounts}</td>
<td>{$data.tfcounts}</td> <td>{$data.ioscount}</td>
<td>{$data.tfcounts}({$data.tfpercent}%)</td>
<td>{$data.supercounts}</td> <td>{$data.supercounts}</td>
<td>{$data.companycounts}</td> <td>{$data.companycounts}</td>
<td>{$data.belongs_president}</td> <td>{$data.belongs_president}</td>
@ -68,7 +79,8 @@
<tr> <tr>
<td>汇总(所有数据)</td> <td>汇总(所有数据)</td>
<td>{$totaluserscounts}</td> <td>{$totaluserscounts}</td>
<td>{$totaltfcounts}</td> <td>{$allIosCounts}</td>
<td>{$totaltfcounts}({$totalpercent}%)</td>
<td>{$totalsupercounts}</td> <td>{$totalsupercounts}</td>
<td>{$totalcompanycounts}</td> <td>{$totalcompanycounts}</td>
<td></td> <td></td>
@ -99,23 +111,58 @@
</div> </div>
</block> </block>
<block name="script"> <block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css"> <link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script> <script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script> <script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script> <script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script> <script type="text/javascript" src="__JS__/common.js"></script>
<script>
setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}";
console.log(date);
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
</script>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
setValue('row', '{:I("get.row",10)}'); setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val() var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ') //defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({ // $('.range-date').flatpickr({
mode: 'range', // mode: 'range',
locale: 'zh', // locale: 'zh',
dateFormat: "Y-m-d", // dateFormat: "Y-m-d",
defaultDate: defaultDate, // defaultDate: defaultDate,
}) // })
$('.select_gallery').select2() $('.select_gallery').select2()
var gameId = $('#game-select').val(); var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val(); var sdkVersion = $('#sdk_version').val();

@ -35,9 +35,19 @@
<option value="3" <if condition="I('type') === '3'">selected</if>>超级签下载</option> <option value="3" <if condition="I('type') === '3'">selected</if>>超级签下载</option>
</select> </select>
</div> </div>
<div class="form-group normal_space fr"> <!-- <div class="form-group normal_space fr">
<label>创建时间:</label> <label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" > <input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div> -->
<div class="form-group normal_space fr" style="display: flex;">
<label class="form-title select-title" style="position: relative;">创建时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div> </div>
<div class="form-group normal_space"> <div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadDetail',['promote_id'=>$promote_id,'belongs_president'=>$belongs_president, 'belongs_department'=>$belongs_department, 'belongs_group'=>$belongs_group])}" <input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadDetail',['promote_id'=>$promote_id,'belongs_president'=>$belongs_president, 'belongs_department'=>$belongs_department, 'belongs_group'=>$belongs_group])}"
@ -79,7 +89,7 @@
</div> </div>
<div class="pagenation clearfix"> <div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?> <?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/iosdetail_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a> <a id="sch-btn" data-href="{:U('download/iosdetail_data_export',array_merge(['xlsname'=>'ceshi','begtime'=>$initBegTime,'endtime'=>$initEndTime],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?> <?php endif ;?>
{$pagination} {$pagination}
</div> </div>
@ -95,22 +105,57 @@
</block> </block>
<block name="script"> <block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css"> <link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script> <script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script> <script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script> <script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script> <script type="text/javascript" src="__JS__/common.js"></script>
<script>
setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}";
console.log(date);
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
</script>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
setValue('row', '{:I("get.row",10)}'); setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val() // var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ') // defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({ // $('.range-date').flatpickr({
mode: 'range', // mode: 'range',
locale: 'zh', // locale: 'zh',
dateFormat: "Y-m-d", // dateFormat: "Y-m-d",
defaultDate: defaultDate, // defaultDate: defaultDate,
}) // })
$('.select_gallery').select2() $('.select_gallery').select2()
var gameId = $('#game-select').val(); var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val(); var sdkVersion = $('#sdk_version').val();

Loading…
Cancel
Save