master
yulingwei 5 years ago
parent 5009a327db
commit 7b3006f871

@ -9037,11 +9037,11 @@ class ExportController extends Controller
$pdlMap .= " and pdl.create_time < {$endTime}"; $pdlMap .= " and pdl.create_time < {$endTime}";
} }
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) { if ($info['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"));
$xlsData = M('promote', 'tab_')->alias('p') $list = M('promote', 'tab_')->alias('p')
->field('count(distinct(u.id)) as iosCount, count(distinct(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")
->where($map) ->where($map)
@ -9057,7 +9057,7 @@ class ExportController extends Controller
->select(); ->select();
} }
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) { if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
foreach($xlsData as &$item) { foreach($xlsData as &$item) {
$item['tfcount'] = $item['tfcount'] . "(" . (isset($item['ioscount']) ? round( ($item['tfcount'] / $item['ioscount']) * 100 , 2) : 0) . ")%"; $item['tfcount'] = $item['tfcount'] . "(" . (isset($item['ioscount']) ? round( ($item['tfcount'] / $item['ioscount']) * 100 , 2) : 0) . ")%";
} }
@ -9079,7 +9079,6 @@ class ExportController extends Controller
); );
} }
$this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出'); $this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData); $this->exportExcel($xlsName, $xlsCell, $xlsData);
} }

Loading…
Cancel
Save