安全下载中心

master
sunke 5 years ago
parent 3b681670df
commit cf1449f09a

@ -72,20 +72,34 @@ class DownloadController extends BaseController {
}
public function listsIndex($p = 0) {
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
$map1['admin_id'] = PID;
$promote = PID;
} else {
$childPromoteIds .= ','.PID;
$map1['admin_id'] = ['in', $childPromoteIds];
$promote = $childPromoteIds;
}
$pro = $_REQUEST['pid'];
if(empty($pro)) {
$map['admin_id'] = $map1['admin_id'];
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$res = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if(empty($res)) {
$map['tab_downloadlog.admin_id'] = PID;
}else {
$map['admin_id'] = intval($pro);
foreach ($res as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_downloadlog.admin_id'] = ['in', $childPromoteIds];
}
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$childPromoteIds = M('promote', 'tab_')->where($map2)->getField('id', true);
$map = [];
if (count($childPromoteIds) > 0) {
$map = ['admin_id' => ['in', $childPromoteIds]];
} else {
$map['_string'] = '1<>1';
}
if(!empty($_REQUEST['dataname'])) {
$map['dataname'] = ['like','%'.$_REQUEST['dataname'].'%'];
@ -112,7 +126,7 @@ class DownloadController extends BaseController {
$rs[$key]['actor'] = $getNameRs['real_name'];
}
$promoteArr = explode(',', $promote);
$promoteArr = explode(',', $childPromoteIds);
$promoteNameArr = [];
foreach ($promoteArr as $key1 => $value1) {
$promoteName = M('promote','tab_')->field("real_name")->where(['id' => intval($value1)])->find();

@ -72,15 +72,36 @@
value="{:I('logid')}">
</div>
<div class="form-group fl" style="margin-left:10px">
<!-- <div class="form-group fl" style="margin-left:10px">
<select id="pid" name="pid" class="reselect select_gallery" style="min-width:200px;width: 175px;">
<option value="0">请选择推广员</option>
<volist name="promoteNameArr" id="vo">
<option value="{$vo.promote_id}" title="{$vo.name}">{$vo.name}</option>
</volist>
</select>
</div>
</div>-->
<input type="hidden" id="top-promote-id" value="{$loginer.id}">
<if condition="$loginer.level elt 1">
<div class="form-group fl" style="margin-left:10px">
<select name="level_promote_2" class="level-promote reselect select_gallery" style="width: 220px;" data-level="2" data-val="{:I('level_promote_2', 0)}">
<option value="0">请选择部门长</option>
</select>
</div>
</if>
<if condition="$loginer.level elt 2">
<div class="form-group fl" style="margin-left:10px">
<select name="level_promote_3" class="level-promote reselect select_gallery" style="width: 220px;" data-level="3" data-val="{:I('level_promote_3', 0)}">
<option value="0">请选择组长</option>
</select>
</div>
</if>
<if condition="$loginer.level elt 3">
<div class="form-group fl" style="margin-left:10px">
<select name="level_promote_4" class="level-promote reselect select_gallery" style="width: 220px;" data-level="4" data-val="{:I('level_promote_4', 0)}">
<option value="0">请选择推广员</option>
</select>
</div>
</if>
<div class="form-group normal_space fl">
<label class="form-title select-title" style="position: relative;">申请时间:</label>
@ -164,7 +185,10 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$().ready(function () {
setValue('team_leader_id', {$Think.request.team_leader_id |default = '""'});
setValue('promote_id', {$Think.request.promote_id |default = 0});

Loading…
Cancel
Save