|
|
|
@ -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();
|
|
|
|
|