master
yulingwei 5 years ago
parent 18b0c3024d
commit b10717e8b6

@ -8504,8 +8504,8 @@ class ExportController extends Controller
$pdlMap .= " and pdl.create_time >={$startTime}"; $pdlMap .= " and pdl.create_time >={$startTime}";
} }
if ($endTime = I('create_time_start')) { if ($endTime = I('create_time_end')) {
$endTime += strtotime($endTime) + 86400; $endTime = strtotime($endTime) + 86400;
$pdlMap .= " and pdl.create_time < {$endTime}"; $pdlMap .= " and pdl.create_time < {$endTime}";
} }
@ -8548,7 +8548,9 @@ class ExportController extends Controller
$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('无效的pid');} // 跳转玩家资料页面 //if ($info['level'] != PromoteModel::LEVEL_GROUP_LEADER) {return $this->error('无效的pid');} // 跳转玩家资料页面
$map['pdl.promote_id'] = $pid; // 获取包括他自己的下级id
$promote_ids = M('promote', 'tab_')->where("chain like '{$info['chain']}{$pid}/%' or (id={$pid}) ")->field('id')->select();
$promote_ids ? $map['pdl.promote_id'] = ['in', array_column($promote_ids, 'id')] : null;
$info['chain'] = $info['level'] == PromoteModel::LEVEL_PRESIDENT ? [$info['id']] : array_merge(explode('/', trim($info['chain'], '/')), [$info['id']]); $info['chain'] = $info['level'] == PromoteModel::LEVEL_PRESIDENT ? [$info['id']] : array_merge(explode('/', trim($info['chain'], '/')), [$info['id']]);
} }
@ -8556,12 +8558,21 @@ class ExportController extends Controller
$map['u.account'] = I('user_account'); $map['u.account'] = I('user_account');
} }
if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime);
$map['_string'] .= " and pdl.create_time >={$startTime}";
}
if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400;
$map['_string'] .= " and pdl.create_time < {$endTime}";
}
$list = M('package_download_log', 'tab_')->alias('pdl') $list = M('package_download_log', 'tab_')->alias('pdl')
->field('pdl.promote_id, pdl.create_time, pdl.type, p.chain, u.account, p.level') ->field('pdl.promote_id, pdl.create_time, pdl.type, p.chain, u.account, p.level')
->join('tab_promote p on p.id = pdl.promote_id') ->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left') ->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map) ->where($map)
->page($p, $row)
->select(); ->select();
$parentIds = []; $parentIds = [];

@ -1166,8 +1166,8 @@ class StatisticsController extends ThinkController {
$pdlMap .= " and pdl.create_time >={$startTime}"; $pdlMap .= " and pdl.create_time >={$startTime}";
} }
if ($endTime = I('create_time_start')) { if ($endTime = I('create_time_end')) {
$endTime += strtotime($endTime) + 86400; $endTime = strtotime($endTime) + 86400;
$pdlMap .= " and pdl.create_time < {$endTime}"; $pdlMap .= " and pdl.create_time < {$endTime}";
} }
@ -1179,7 +1179,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(pdl.id) 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(pdl.id) 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_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')
@ -1194,7 +1193,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(p2.id) 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(p2.id) 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')
@ -1231,7 +1229,9 @@ 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('无效的pid');} // 跳转玩家资料页面 //if ($info['level'] != PromoteModel::LEVEL_GROUP_LEADER) {return $this->error('无效的pid');} // 跳转玩家资料页面
$map['pdl.promote_id'] = $pid; // 获取包括他自己的下级id
$promote_ids = M('promote', 'tab_')->where("chain like '{$info['chain']}{$pid}/%' or (id={$pid}) ")->field('id')->select();
$promote_ids ? $map['pdl.promote_id'] = ['in', array_column($promote_ids, 'id')] : null;
$info['chain'] = $info['level'] == PromoteModel::LEVEL_PRESIDENT ? [$info['id']] : array_merge(explode('/', trim($info['chain'], '/')), [$info['id']]); $info['chain'] = $info['level'] == PromoteModel::LEVEL_PRESIDENT ? [$info['id']] : array_merge(explode('/', trim($info['chain'], '/')), [$info['id']]);
} }
@ -1239,6 +1239,16 @@ class StatisticsController extends ThinkController {
$map['u.account'] = I('user_account'); $map['u.account'] = I('user_account');
} }
if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime);
$map['_string'] .= " and pdl.create_time >={$startTime}";
}
if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400;
$map['_string'] .= " and pdl.create_time < {$endTime}";
}
$list = M('package_download_log', 'tab_')->alias('pdl') $list = M('package_download_log', 'tab_')->alias('pdl')
->field('pdl.promote_id, pdl.create_time, pdl.type, p.chain, u.account, p.level') ->field('pdl.promote_id, pdl.create_time, pdl.type, p.chain, u.account, p.level')
->join('tab_promote p on p.id = pdl.promote_id') ->join('tab_promote p on p.id = pdl.promote_id')
@ -1250,11 +1260,13 @@ class StatisticsController extends ThinkController {
$total = M('package_download_log', 'tab_')->alias('pdl') $total = M('package_download_log', 'tab_')->alias('pdl')
->field('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(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 p on p.id = pdl.promote_id') ->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map) ->where($map)
->select(); ->select();
$count = M('package_download_log', 'tab_')->alias('pdl') $count = M('package_download_log', 'tab_')->alias('pdl')
->join('tab_promote p on p.id = pdl.promote_id') ->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map) ->where($map)
->count(); ->count();

@ -62,6 +62,7 @@
url="{:U('Statistics/packdownload','model='.$model['name'] . '&row=' . I('row'),false)}"> url="{:U('Statistics/packdownload','model='.$model['name'] . '&row=' . I('row'),false)}">
搜索 搜索
</a> </a>
<a class="sch-btn" onclick="javascript:void(window.history.go(-1))">返回</a>
</div> </div>
</div> </div>
</div> </div>
@ -118,7 +119,7 @@
<?php if($data['level'] < 4):?> <?php if($data['level'] < 4):?>
<a href="{:U('Statistics/packdownload',array('level'=>$level+1))}">查看所有下级 </a> <a href="{:U('Statistics/packdownload',array('level'=>$level+1))}">查看所有下级 </a>
<?php else:?> <?php else:?>
<a href="{:U('Statistics/packuserdownload')}">查看下级 </a> <a href="{:U('Statistics/packuserdownload')}">查看所有下级 </a>
<?php endif;?> <?php endif;?>
</td> </td>

@ -80,6 +80,7 @@
url="{:U('Statistics/packuserdownload','model='.$model['name'] . '&row=' . I('row'),false)}"> url="{:U('Statistics/packuserdownload','model='.$model['name'] . '&row=' . I('row'),false)}">
搜索 搜索
</a> </a>
<a class="sch-btn" onclick="javascript:void(window.history.go(-1))">返回</a>
</div> </div>
</div> </div>
</div> </div>
@ -258,8 +259,8 @@
// 清除下级联动数据 // 清除下级联动数据
var childrens = $(obj).parents('.search_label_rehab').nextAll().children('.promote-id'); var childrens = $(obj).parents('.search_label_rehab').nextAll().children('.promote-id');
$.each(childrens, function(index, item){ $.each(childrens, function(index, item){
$(item).empty().select2(); var title = $(item).attr('data-title');
$("#select2-"+$(item).attr('id')+"-container").html($(item).attr('data-title')); $(item).empty().html("<option value='' selected>"+title+"</option>").select2();
}); });
var next = $(obj).parents('.search_label_rehab').next().children('.promote-id'); var next = $(obj).parents('.search_label_rehab').next().children('.promote-id');

Loading…
Cancel
Save