diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 0f2cf9239..7c3363fe0 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -8478,7 +8478,7 @@ class ExportController extends Controller addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U($url,$GetData),'menu'=>$menu]); } - public function exportPackDownload($pid=0, $level=PromoteModel::LEVEL_PRESIDENT) + public function exportPackDownload($pid=0, $level=0) { $xlsName = 'IOS下载统计报表'; @@ -8487,9 +8487,10 @@ class ExportController extends Controller if ($pid) { $info = M('promote', 'tab_')->where(['id'=>$pid])->find(); if (empty($info)) return $this->error('未找到该用户'); - $level = $map['p.level'] = $info['level'] + 1; - $map['p.parent_id'] = $pid; + $level = $map['p.level'] = ($level ? $level : $info['level'] + 1); + $map['_string'] .= " and p.chain like '{$info['chain']}{$pid}/%' "; } else { + $level = $level ?: PromoteModel::LEVEL_PRESIDENT; $map['p.level'] = $level; } diff --git a/Application/Admin/Controller/StatisticsController.class.php b/Application/Admin/Controller/StatisticsController.class.php index 664f6807f..b68b7b362 100644 --- a/Application/Admin/Controller/StatisticsController.class.php +++ b/Application/Admin/Controller/StatisticsController.class.php @@ -1139,7 +1139,7 @@ class StatisticsController extends ThinkController { $this->display('ltv'); } - public function packDownload($p=1, $row=10, $pid = 0, $level=PromoteModel::LEVEL_PRESIDENT) + public function packDownload($p=1, $row=10, $pid = 0, $level=0) { $map = []; $map['_string'] = " 1=1 "; @@ -1147,9 +1147,10 @@ class StatisticsController extends ThinkController { $info = M('promote', 'tab_')->where(['id'=>$pid])->find(); if (empty($info)) return $this->error('未找到该用户'); //if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {return $this->error('跳转玩家资料页面');} // 跳转玩家资料页面 - $level = $map['p.level'] = $info['level'] + 1; - $map['p.parent_id'] = $pid; + $level = $map['p.level'] = ($level ? $level : $info['level'] + 1); + $map['_string'] .= " and p.chain like '{$info['chain']}{$pid}/%' "; } else { + $level = $level ?: PromoteModel::LEVEL_PRESIDENT; $map['p.level'] = $level; //if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {return $this->error('跳转玩家资料页面');} // 跳转玩家资料页面 } @@ -1193,7 +1194,6 @@ class StatisticsController extends ThinkController { ->page($p, $row) ->group('p.id') ->select(); - $total = M('promote', 'tab_')->alias('p') ->field('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') ->join("tab_promote p2 on p2.chain like CONCAT(p.chain, p.id, '/%') or p2.id = p.id", 'left') diff --git a/Application/Admin/View/Statistics/packdownload.html b/Application/Admin/View/Statistics/packdownload.html index d8ece1783..4d1de96b5 100644 --- a/Application/Admin/View/Statistics/packdownload.html +++ b/Application/Admin/View/Statistics/packdownload.html @@ -118,9 +118,13 @@