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

ios下载量数据统计
master
廖金灵 5 years ago committed by Gogs
commit eb9f84c5dd

@ -174,6 +174,118 @@ class DownloadController extends BaseController {
return $this->display();
}
/**
* IOS详细下载数统计
* @author sunke
*/
public function iosdetail_data_export() {
$promote_id = $_REQUEST['promote_id'];
$belongs_president = $_REQUEST['belongs_president'];
$belongs_department = $_REQUEST['belongs_department'];
$belongs_group = $_REQUEST['belongs_group'];
$user_account = $_REQUEST['user_account'];
$type = $_REQUEST['type'];
$createTime = I('create_time', '');
if(!empty($_REQUEST['promote_id'])) {
$map['promote_id'] = $_REQUEST['promote_id'];
}
if(!empty($_REQUEST['belongs_president'])) {
$map['belongs_president'] = $_REQUEST['belongs_president'];
}
if(!empty($_REQUEST['belongs_department'])) {
$map['belongs_department'] = $_REQUEST['belongs_department'];
}
if(!empty($_REQUEST['belongs_group'])) {
$map['belongs_group'] = $_REQUEST['belongs_group'];
}
if($user_account) {
$user_id = M('user', 'tab_')->where(['account'=>$user_account])->getField('id');
$map['user_id'] = $user_id;
}
if($type) {
$map['type'] = $type;
}
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]];
}
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
'logid' => 'IOSdetail_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/iosDownLoadDetail',
'dataname' => 'IOS玩家详情下载统计',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
/**
* IOS下载数统计
* @author sunke
*/
public function ios_data_export() {
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map = [];
$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');
}
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
$map['pid'] = PID;
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
'logid' => 'IOS_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/iosDownLoadData',
'dataname' => 'IOS下载统计',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
/**
* 每日概况
* @author sunke
@ -2103,12 +2215,251 @@ class DownloadController extends BaseController {
case "推广员操作日志":
$this->promotelogsExcelInfo($id,$map);
break;
case "IOS下载统计":
$this->iosDataExcelInfo($id,$map);
break;
case "IOS玩家详情下载统计":
$this->iosDetailExcelInfo($id,$map);
break;
default:
break;
}
}
public function iosDetailExcelInfo($id,$map) {
$xlsName ="IOS详情下载数统计";
$xlsCell = array(
'玩家账号',
'类型',
'时间',
'所属推广员',
'所属会长',
'所属部门长',
'所属组长'
);
if (!empty($map['user_id'])) {
$map1['user_id'] = $map['user_id'];
}
if (!empty($map['type'])) {
$map1['type'] = $map['type'];
}
if (!empty($map['create_time'])) {
$map1['create_time'] = $map['create_time'];
$tfMap['create_time'] = $map['craete_time'];
$superMap['create_time'] = $map['craete_time'];
$companyMap['create_time'] = $map['craete_time'];
}
$belongs_president = '';
$belongs_department = '';
$belongs_group = '';
if (!empty($map['belongs_president'])) {
$belongs_president = $map['belongs_president'];
}
if (!empty($map['belongs_department'])) {
$belongs_department = $map['belongs_department'];
}
if (!empty($map['belongs_group'])) {
$belongs_group = $map['belongs_group'];
}
if (!empty($map['promote_id'])) {
$promote_id = $map['promote_id'];
}
$rs = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1)->select();
$tfMap['promote_id'] = $promote_id;
$tfMap['type'] = 2;
$TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count();
$superMap['promote_id'] = $promote_id;
$superMap['type'] = 3;
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count();
$companyMap['promote_id'] = $promote_id;
$companyMap['type'] = 1;
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
$csvFileName = $xlsName.'.csv';
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('gb2312', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = count($rs)?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
$data = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1)
->limit(($i-1)*$perSize ,$perSize)->select();
foreach($data as $key => $value) {
$user_id = $value['user_id'];
$usersAccount = M('user', 'tab_')->where(['id' => $user_id])->getField('account');
$csvData['account'] = $usersAccount;
if ($value['type'] == 1) {
$csvData['typename'] = "企业签下载";
}
if($value['type'] == 2) {
$csvData['typename'] = "TF下载";
}
if($value['type'] == 3) {
$csvData['typename'] = "超级签下载";
}
$csvData['create_time'] = date('Y-m-d H:i:s', $package['crate_time']);
$promoteInfo = M('promote', 'tab_')->field('account')->where(['id'=>$promote_id])->find();
$csvData['promote_account'] = $promoteInfo['account'];
$csvData['belongs_president'] = $belongs_president;
$csvData['belongs_department'] = $belongs_department;
$csvData['belongs_group'] = $belongs_group;
mb_convert_variables('GBK', 'UTF-8', $csvData);
fputcsv($fp, $csvData);
$xlsData[] = $csvData;
}
unset($xlsData);
ob_flush();
flush();
}
$allData['account'] = '汇总';
$allData['typename'] = "TF下载次数".$TFCounts;
$allData['create_time'] = "超级签下载次数:".$superCounts;
$allData['promote_account'] = "企业签下载次数:".$companyCounts;
mb_convert_variables('GBK', 'UTF-8', $allData);
fputcsv($fp, $allData);
$xlsData[] = $allData;
fclose($fp);
$this->backSuccessExport($id);
}
public function iosDataExcelInfo($tid,$map) {
$xlsName ="IOS下载数统计";
$xlsCell = array(
'推广员账号',
'玩家人数',
'TF下载次数',
'超级签下载次数',
'企业签下载次数',
'所属会长',
'所属部门长',
'所属组长'
);
$pid = $map['pid'];
unset($map['pid']);
$map1['chain'] = $map['chain'];
if (!empty($map['create_time'])) {
$map2['create_time'] = $map['create_time'];
$tfMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['create_time'];
}
$rs = M('promote', 'tab_')->field(['id'])->where($map1)->select();
$allids = array_column($rs, 'id');
$allUserMap['promote_id'] = ['in', $allids];
$allTFMap['promote_id'] = ['in', $allids];
$allTFMap['type'] = 2;
$allSuperMap['promote_id'] = ['in', $allids];
$allSuperMap['type'] = 3;
$companyMap['promote_id'] = ['in', $allids];
$companyMap['type'] = 1;
$allUsersCounts = M('user', 'tab_')->where($allUserMap)->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();
$csvFileName = $xlsName.'.csv';
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('gb2312', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = count($rs)?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
$data = M('promote', 'tab_')->field(['id'])->where($map1)
->limit(($i-1)*$perSize ,$perSize)->select();
$ids = array_column($data, 'id');
foreach($ids as $key => $id) {
$promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select();
$promote = $promote1[0];
$chain = $promote['chain'];
//$csvData['promote_id'] = $id;
$csvData['account'] = $promote['account'];
$tfMap['promote_id'] = $id;
$tfMap['type'] = 2;
$companyMap['promote_id'] = $id;
$companyMap['type'] = 1;
$superMap['promote_id'] = $id;
$superMap['type'] = 3;
$tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id])->count();
$csvData['userscounts'] = intval($usersCounts);
$csvData['tfcounts'] = intval($tfCounts);
$csvData['supercounts'] = intval($superCounts);
$csvData['companycounts'] = intval($companyCounts);
if($promote['level'] == 1) {
$csvData['belongs_president'] = $promote['account'];
$csvData['belongs_department'] = "无所属部门长";
$csvData['belongs_group'] = "无所属组长";
}
if ($promote['level'] == 2) {
$parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select();
$csvData['belongs_president'] = $parentPromote['account'];
$csvData['belongs_department'] = $promote['account'];
$csvData['belongs_group'] = "无所属组长";
}
if ($promote['level'] == 3) {
$chainArr = explode('/', $chain);
$presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account');
$departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account');
$csvData['belongs_president'] = $presidentAccount;
$csvData['belongs_department'] = $departmentAccount;
$csvData['belongs_group'] = $promote['account'];
}
if ($promote['level'] == 4) {
$chainArr = explode('/', $chain);
$presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account');
$departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account');
$groupAccount = M('promote', 'tab_')->where(['id' => $chainArr[3]])->getField('account');
$csvData['belongs_president'] = $presidentAccount;
$csvData['belongs_department'] = $departmentAccount;
$csvData['belongs_group'] = $groupAccount;
}
mb_convert_variables('GBK', 'UTF-8', $csvData);
fputcsv($fp, $csvData);
$xlsData[] = $csvData;
}
unset($xlsData);
ob_flush();
flush();
}
$allData['account'] = '汇总';
$allData['userscounts'] = $allUsersCounts;
$allData['tfcounts'] = $allTFCounts;
$allData['supercounts'] = $allSuperCounts;
$allData['companycounts'] = $allCompanyCounts;
$allData['belongs_president'] = '--';
$allData['belongs_department'] = '--';
$allData['belongs_group'] = '--';
mb_convert_variables('GBK', 'UTF-8', $allData);
fputcsv($fp, $allData);
$xlsData[] = $allData;
fclose($fp);
$this->backSuccessExport($tid);
}
public function promotelogsExcelInfo($id,$map) {
$xlsName = "推广员操作日志";
$xlsCell = array(

@ -2489,4 +2489,195 @@ class QueryController extends BaseController
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
public function iosDownLoadData() {
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$loginPromote = $this->getLoginPromote();
$map = [];
$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]];
}
$query = M('promote', 'tab_')->field(['id'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
// $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');
$map = [];
$map['tab_package_download_log.promote_id'] = ['in', $ids];
// $data = M('package_download_log','tab_')->where($map)->select();
$listData = [];
$allUserMap['promote_id'] = ['in', $allids];
$allTFMap['promote_id'] = ['in', $allids];
$allTFMap['type'] = 2;
$allSuperMap['promote_id'] = ['in', $allids];
$allSuperMap['type'] = 3;
$companyMap['promote_id'] = ['in', $allids];
$companyMap['type'] = 1;
$allUsersCounts = M('user', 'tab_')->where($allUserMap)->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();
foreach ($ids as $key => $id) {
$promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select();
$promote = $promote1[0];
$chain = $promote['chain'];
$listData[$key]['promote_id'] = $id;
$listData[$key]['account'] = $promote['account'];
$tfMap['promote_id'] = $id;
$tfMap['type'] = 2;
$companyMap['promote_id'] = $id;
$companyMap['type'] = 1;
$superMap['promote_id'] = $id;
$superMap['type'] = 3;
$tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量
$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]['companycounts'] = intval($companyCounts);
$listData[$key]['supercounts'] = intval($superCounts);
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id])->count();
$listData[$key]['userscounts'] = intval($usersCounts);
if($promote['level'] == 1) {
$listData[$key]['belongs_president'] = $promote['account'];
$listData[$key]['belongs_department'] = "无所属部门长";
$listData[$key]['belongs_group'] = "无所属组长";
}
if ($promote['level'] == 2) {
$parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select();
$listData[$key]['belongs_president'] = $parentPromote['account'];
$listData[$key]['belongs_department'] = $promote['account'];
$listData[$key]['belongs_group'] = "无所属组长";
}
if ($promote['level'] == 3) {
$chainArr = explode('/', $chain);
$presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account');
$departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account');
$listData[$key]['belongs_president'] = $presidentAccount;
$listData[$key]['belongs_department'] = $departmentAccount;
$listData[$key]['belongs_group'] = $promote['account'];
}
if ($promote['level'] == 4) {
$chainArr = explode('/', $chain);
$presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account');
$departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account');
$groupAccount = M('promote', 'tab_')->where(['id' => $chainArr[3]])->getField('account');
$listData[$key]['belongs_president'] = $presidentAccount;
$listData[$key]['belongs_department'] = $departmentAccount;
$listData[$key]['belongs_group'] = $groupAccount;
}
}
$this->assign('listdata', $listData);
$this->assign('totaluserscounts', $allUsersCounts);
$this->assign('totaltfcounts', $allTFCounts);
$this->assign('totalsupercounts', $allSuperCounts);
$this->assign('pagination', $pagination);
$this->assign('totalcompanycounts', $allCompanyCounts);
$this->display();
}
public function iosDownLoadDetail() {
$promote_id = $_REQUEST['promote_id'];
$belongs_president = $_REQUEST['belongs_president'];
$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]];
}
if(!empty(I('user_account'))) {
$user_id = M('user', 'tab_')->where(['account'=>I('user_account')])->getField('id');
$map['user_id'] = $user_id;
$tfMap['user_id'] = $user_id;
$superMap['user_id'] = $user_id;
$companyMap['user_id'] = $user_id;
}
if(!empty(I('type'))) {
$map['type'] = I('type');
}
$map['promote_id'] = $promote_id;
//$packAges = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where(['promote_id'=>$promote_id])->select();
$query = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map);
list($packAges, $pagination, $count) = $this->paginate($query);
foreach ($packAges as $key =>$package) {
$user_id = $package['user_id'];
$usersAccount = M('user', 'tab_')->where(['id' => $user_id])->getField('account');
$packAges[$key]['account'] = $usersAccount;
if ($package['type'] == 1) {
$packAges[$key]['typename'] = "企业签下载";
}
if($package['type'] == 2) {
$packAges[$key]['typename'] = "TF下载";
}
if($package['type'] == 3) {
$packAges[$key]['typename'] = "超级签下载";
}
$packAges[$key]['create_time'] = date('Y-m-d H:i:s', $package['crate_time']);
$promoteInfo = M('promote', 'tab_')->field('account')->where(['id'=>$promote_id])->find();
$packAges[$key]['promote_account'] = $promoteInfo['account'];
$packAges[$key]['belongs_president'] = $belongs_president;
$packAges[$key]['belongs_department'] = $belongs_department;
$packAges[$key]['belongs_group'] = $belongs_group;
}
$tfMap['promote_id'] = $promote_id;
$tfMap['type'] = 2;
$TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count();
$superMap['promote_id'] = $promote_id;
$superMap['type'] = 3;
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count();
$companyMap['promote_id'] = $promote_id;
$companyMap['type'] = 1;
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
$this->assign('promote_id', $promote_id);
$this->assign('TFCounts', $TFCounts);
$this->assign('superCounts', $superCounts);
$this->assign('companyCounts', $companyCounts);
$this->assign('belongs_president', $belongs_president);
$this->assign('belongs_department', $belongs_department);
$this->assign('belongs_group', $belongs_group);
$this->assign('pagination', $pagination);
$this->assign('datas', $packAges);
$this->display();
}
}

@ -73,6 +73,7 @@
<?php endif;?>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
<a href="{:U('Query/promoteQuota')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq promoteQuota or ACTION_NAME eq quotaDtl) '>active</if> ">推广员指标</a>
<a href="{:U('Query/iosDownLoadData')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq iosDownLoadData or ACTION_NAME eq iosDownLoadData) '>active</if> ">IOS下载数统计</a>
</div>
<?php endif;?>

@ -0,0 +1,172 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>IOS下载数统计</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">IOS下载数统计</span>
<span class="details">说明TF下载统计的下载次数是流程点击安装包的记录值所以会大于等于实际下载次数数据提供其他使用进行参考。</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<include file="Public/promote_select" />
<div class="form-group normal_space fr">
<label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadData','model='.$model['name'],false)}"
value="查询">
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>推广员账号</th>
<th>玩家人数</th>
<th>TF下载次数</th>
<th>超级签下载次数</th>
<th>企业签下载次数</th>
<th>所属会长</th>
<th>所属部门长</th>
<th>所属组长</th>
<th>操作</th>
</tr>
<empty name="listdata">
<tr><td colspan="8" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="listdata" id="data" mod="2">
<tr>
<td>{$data.account}</td>
<td>{$data.userscounts}</td>
<td>{$data.tfcounts}</td>
<td>{$data.supercounts}</td>
<td>{$data.companycounts}</td>
<td>{$data.belongs_president}</td>
<td>{$data.belongs_department}</td>
<td>{$data.belongs_group}</td>
<td>
<a href="{:U('Query/iosDownLoadDetail',['promote_id' => $data['promote_id'], 'belongs_president'=>$data['belongs_president'], 'belongs_department'=>$data['belongs_department'], 'belongs_group'=>$data['belongs_group']])}" style="cursor: pointer" class="chakan">查看</a>
</td>
</tr>
</volist>
<tr>
<td>汇总(所有数据)</td>
<td>{$totaluserscounts}</td>
<td>{$totaltfcounts}</td>
<td>{$totalsupercounts}</td>
<td>{$totalcompanycounts}</td>
<td></td>
<td></td>
<td></td>
<td>
</td>
</tr>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/ios_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.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__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$('#submit').click(function () {
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
})
</script>
</block>

@ -0,0 +1,167 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>IOS下载数统计</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">IOS下载数统计</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号"
value="{:I('user_account')}">
</div>
<div class="form-group normal_space">
<select id="type" name="type" class="reselect select_gallery" style="width: 220px;" >
<option value="0">类型</option>
<option value="1" <if condition="I('type') === '1'">selected</if>>企业签下载</option>
<option value="2" <if condition="I('type') === '2'">selected</if>>TF下载</option>
<option value="3" <if condition="I('type') === '3'">selected</if>>超级签下载</option>
</select>
</div>
<div class="form-group normal_space fr">
<label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div>
<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])}"
value="查询">
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>玩家账号</th>
<th>类型</th>
<th>时间</th>
<th>所属推广员</th>
<th>所属会长</th>
<th>所属部门长</th>
<th>所属组长</th>
</tr>
<empty name="datas">
<tr><td colspan="8" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="datas" id="data" mod="2">
<tr>
<td>{$data.account}</td>
<td>{$data.typename}</td>
<td>{$data.create_time}</td>
<td>{$data.promote_account}</td>
<td>{$data.belongs_president}</td>
<td>{$data.belongs_department}</td>
<td>{$data.belongs_group}</td>
</tr>
</volist>
<tr>
<td>汇总(所有数据)</td>
<td>TF下载次数{$TFCounts} &nbsp;&nbsp; 超级签下载次数:{$superCounts} &nbsp;&nbsp; 企业签下载次数:{$companyCounts}</td>
</tr>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?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>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.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__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$('#submit').click(function () {
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
})
</script>
</block>
Loading…
Cancel
Save