|
|
@ -1139,7 +1139,7 @@ class StatisticsController extends ThinkController {
|
|
|
|
$this->display('ltv');
|
|
|
|
$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 = [];
|
|
|
|
$map['_string'] = " 1=1 ";
|
|
|
|
$map['_string'] = " 1=1 ";
|
|
|
@ -1147,9 +1147,10 @@ class StatisticsController extends ThinkController {
|
|
|
|
$info = M('promote', 'tab_')->where(['id'=>$pid])->find();
|
|
|
|
$info = M('promote', 'tab_')->where(['id'=>$pid])->find();
|
|
|
|
if (empty($info)) return $this->error('未找到该用户');
|
|
|
|
if (empty($info)) return $this->error('未找到该用户');
|
|
|
|
//if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {return $this->error('跳转玩家资料页面');} // 跳转玩家资料页面
|
|
|
|
//if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {return $this->error('跳转玩家资料页面');} // 跳转玩家资料页面
|
|
|
|
$level = $map['p.level'] = $info['level'] + 1;
|
|
|
|
$level = $map['p.level'] = ($level ? $level : $info['level'] + 1);
|
|
|
|
$map['p.parent_id'] = $pid;
|
|
|
|
$map['_string'] .= " and p.chain like '{$info['chain']}{$pid}/%' ";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$level = $level ?: PromoteModel::LEVEL_PRESIDENT;
|
|
|
|
$map['p.level'] = $level;
|
|
|
|
$map['p.level'] = $level;
|
|
|
|
//if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {return $this->error('跳转玩家资料页面');} // 跳转玩家资料页面
|
|
|
|
//if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {return $this->error('跳转玩家资料页面');} // 跳转玩家资料页面
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1193,7 +1194,6 @@ class StatisticsController extends ThinkController {
|
|
|
|
->page($p, $row)
|
|
|
|
->page($p, $row)
|
|
|
|
->group('p.id')
|
|
|
|
->group('p.id')
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
|
|
$total = M('promote', 'tab_')->alias('p')
|
|
|
|
$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')
|
|
|
|
->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')
|
|
|
|
->join("tab_promote p2 on p2.chain like CONCAT(p.chain, p.id, '/%') or p2.id = p.id", 'left')
|
|
|
|