|
|
|
@ -2491,7 +2491,6 @@ class QueryController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function iosDownLoadData() {
|
|
|
|
|
|
|
|
|
|
$page = intval(I('get.p', 1));
|
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据arraypage
|
|
|
|
|
$row = intval(I('get.row', 10));
|
|
|
|
@ -2504,31 +2503,32 @@ class QueryController extends BaseController
|
|
|
|
|
}else {
|
|
|
|
|
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
|
|
|
|
|
}
|
|
|
|
|
$createTime = I('create_time', '');
|
|
|
|
|
if ($createTime != '') {
|
|
|
|
|
$createTimeRow = explode(' 至 ', $createTime);
|
|
|
|
|
$createTimeBegin = 0;
|
|
|
|
|
$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]];
|
|
|
|
|
$iostime = time();
|
|
|
|
|
$sunday = strtotime('-1 sunday', $iostime) + 24 * 3600;
|
|
|
|
|
if (I('begtime') && I('endtime')) {
|
|
|
|
|
$iostime = strtotime(I('endtime'));
|
|
|
|
|
$sunday = strtotime(I('begtime'));
|
|
|
|
|
}
|
|
|
|
|
$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]];
|
|
|
|
|
|
|
|
|
|
$query = M('promote', 'tab_')->field(['id'])->where($map);
|
|
|
|
|
list($promotes, $pagination, $count) = $this->paginate($query);
|
|
|
|
|
$ids = array_column($promotes, 'id');
|
|
|
|
|
if ($page == 1) {
|
|
|
|
|
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();
|
|
|
|
|
$allids = array_column($allPromote, 'id');
|
|
|
|
|
array_push($allids, PID);
|
|
|
|
@ -2538,13 +2538,22 @@ class QueryController extends BaseController
|
|
|
|
|
// $data = M('package_download_log','tab_')->where($map)->select();
|
|
|
|
|
$listData = [];
|
|
|
|
|
$allUserMap['promote_id'] = ['in', $allids];
|
|
|
|
|
$allUserMap['device_type'] = 2;
|
|
|
|
|
$allTFMap['promote_id'] = ['in', $allids];
|
|
|
|
|
$allTFMap['type'] = 2;
|
|
|
|
|
$allTFMap['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
$allSuperMap['promote_id'] = ['in', $allids];
|
|
|
|
|
$allSuperMap['type'] = 3;
|
|
|
|
|
$allSuperMap['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
$companyMap['promote_id'] = ['in', $allids];
|
|
|
|
|
$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();
|
|
|
|
|
$allIosCounts = M('user', 'tab_')->where($alliosMap)->count();
|
|
|
|
|
|
|
|
|
|
$allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count();
|
|
|
|
|
$allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count();
|
|
|
|
|
$allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
|
|
|
|
@ -2559,6 +2568,10 @@ class QueryController extends BaseController
|
|
|
|
|
}else {
|
|
|
|
|
$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['type'] = 2;
|
|
|
|
|
$companyMap['promote_id'] = $id;
|
|
|
|
@ -2569,9 +2582,13 @@ class QueryController extends BaseController
|
|
|
|
|
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->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]['supercounts'] = intval($superCounts);
|
|
|
|
|
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id])->count();
|
|
|
|
|
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id, 'device_type' => 2])->count();
|
|
|
|
|
$listData[$key]['userscounts'] = intval($usersCounts);
|
|
|
|
|
if($promote['level'] == 1) {
|
|
|
|
|
$listData[$key]['belongs_president'] = $promote['account'];
|
|
|
|
@ -2610,6 +2627,10 @@ class QueryController extends BaseController
|
|
|
|
|
$this->assign('totalsupercounts', $allSuperCounts);
|
|
|
|
|
$this->assign('pagination', $pagination);
|
|
|
|
|
$this->assign('totalcompanycounts', $allCompanyCounts);
|
|
|
|
|
$this->assign('initBegTime', $initBegTime);
|
|
|
|
|
$this->assign('initEndTime', $initEndTime);
|
|
|
|
|
$this->assign('allIosCounts', $allIosCounts);
|
|
|
|
|
$this->assign('tfpercent', $tfpercent);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2619,22 +2640,21 @@ class QueryController extends BaseController
|
|
|
|
|
$belongs_department = $_REQUEST['belongs_department'];
|
|
|
|
|
$belongs_group = $_REQUEST['belongs_group'];
|
|
|
|
|
$createTime = I('create_time', '');
|
|
|
|
|
if ($createTime != '') {
|
|
|
|
|
$createTimeRow = explode(' 至 ', $createTime);
|
|
|
|
|
$createTimeBegin = 0;
|
|
|
|
|
$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');
|
|
|
|
|
}
|
|
|
|
|
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
|
|
|
|
|
$tfMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
|
|
|
|
|
$superMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
|
|
|
|
|
$companyMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$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;
|
|
|
|
|
|
|
|
|
|
$map['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
$tfMap['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
$superMap['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
$companyMap['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
|
|
|
|
|
|
if(!empty(I('user_account'))) {
|
|
|
|
|
$user_id = M('user', 'tab_')->where(['account'=>I('user_account')])->getField('id');
|
|
|
|
|
$map['user_id'] = $user_id;
|
|
|
|
|