修复会员层级关系检索问题

master
yulingwei 5 years ago
parent c40f5dda26
commit bec210c158

@ -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;
}

@ -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')

@ -118,9 +118,13 @@
<td>{$total[0]['signcount']}</td>
<td>
<?php if($data['level'] < 4):?>
<a href="{:U('Statistics/packdownload',array('level'=>$level+1))}">查看所有下级 </a>
<a href="{:U('Statistics/packdownload',array('pid'=>I('pid'), 'level'=>$level+1))}">查看所有下级 </a>
<?php else:?>
<a href="{:U('Statistics/packuserdownload')}">查看所有下级 </a>
<?php if (empty(I('pid'))):?>
<a href="{:U('Statistics/packuserdownload')}">查看所有数据 </a>
<?php else:?>
<a href="{:U('Statistics/packuserdownload',array('pid'=>I('pid')))}">查看所有下级 </a>
<?php endif;?>
<?php endif;?>
</td>

@ -274,7 +274,12 @@
var next = $(obj).parents('.search_label_rehab').next().children('.promote-id');
var text = next.attr('data-title');
var pid = $(obj).val();
if (pid == '' && level > 1) {
$("#promote_id").val($('#promote'+(level-1)).val());
} else {
$("#promote_id").val(pid);
}
// 获取下级数据
$.ajax({

Loading…
Cancel
Save