From cf1449f09a5a39938ec6c723652a1fdb34784d56 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Thu, 14 Nov 2019 09:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=B8=8B=E8=BD=BD=E4=B8=AD?= =?UTF-8?q?=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 42 ++++++++++++------- .../View/default/Download/listsIndex.html | 30 +++++++++++-- 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 36dcbc2aa..147bd39ff 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -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(); diff --git a/Application/Home/View/default/Download/listsIndex.html b/Application/Home/View/default/Download/listsIndex.html index a3de12995..f91e25fa7 100644 --- a/Application/Home/View/default/Download/listsIndex.html +++ b/Application/Home/View/default/Download/listsIndex.html @@ -72,15 +72,36 @@ value="{:I('logid')}"> -