|
|
@ -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'];
|
|
|
@ -265,6 +262,9 @@ class DownloadController extends BaseController {
|
|
|
|
$endTime += 3600 * 24;
|
|
|
|
$endTime += 3600 * 24;
|
|
|
|
$map['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
$map['create_time'] = ['between', [$begTime, $endTime]];
|
|
|
|
$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 = [
|
|
|
@ -2248,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 = '';
|
|
|
@ -2267,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();
|
|
|
@ -2366,12 +2368,15 @@ public function iosDetailExcelInfo($id,$map) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
$allUserMap['device_type'] = 2;
|
|
|
@ -2409,7 +2414,12 @@ public function iosDetailExcelInfo($id,$map) {
|
|
|
|
->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();
|
|
|
@ -2451,7 +2461,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'] = "无所属组长";
|
|
|
|
}
|
|
|
|
}
|
|
|
|