|
|
@ -9037,16 +9037,17 @@ class ExportController extends Controller
|
|
|
|
$pdlMap .= " and pdl.create_time < {$endTime}";
|
|
|
|
$pdlMap .= " and pdl.create_time < {$endTime}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($info['level'] == PromoteModel::LEVEL_TEAM_MEMBER) {
|
|
|
|
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
|
|
|
|
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
|
|
|
|
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
|
|
|
|
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
|
|
|
|
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
|
|
|
|
$list = M('promote', 'tab_')->alias('p')
|
|
|
|
$xlsData = M('promote', 'tab_')->alias('p')
|
|
|
|
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
|
|
|
|
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
|
|
|
|
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
|
|
|
|
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
|
|
|
|
->join("tab_user u on u.promote_id = p.id and u.device_type=2")
|
|
|
|
->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->group('p.id')
|
|
|
|
->group('p.id')
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$xlsData = M('promote', 'tab_')->alias('p')
|
|
|
|
$xlsData = M('promote', 'tab_')->alias('p')
|
|
|
|
->field('p.id, p.level, p.account, count(if(p2.level = '.($level+1).', 1, null)) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
|
|
|
|
->field('p.id, p.level, p.account, count(if(p2.level = '.($level+1).', 1, null)) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
|
|
|
@ -9078,7 +9079,6 @@ class ExportController extends Controller
|
|
|
|
array('signcount', "企业签下载数"),
|
|
|
|
array('signcount', "企业签下载数"),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出');
|
|
|
|
$this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出');
|
|
|
|
$this->exportExcel($xlsName, $xlsCell, $xlsData);
|
|
|
|
$this->exportExcel($xlsName, $xlsCell, $xlsData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|