From 05bb9b4aa3ba712199e5489f684bc7a8cfeb59c8 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 20 Nov 2019 11:40:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E4=B8=9A=E7=BB=A9=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 17 ++++++++++++++--- .../Home/View/default/Query/achievement.html | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index f710e8b92..12cee01e5 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1341,11 +1341,21 @@ class DownloadController extends BaseController { $ids = array_column($data, 'id'); $rows = []; if (count($ids) > 0) { - $rows = M('promote', 'tab_')->field(['id', 'parent_id'])->where(['parent_id' => ['in', $ids]])->select(); + $rows = M('promote', 'tab_') + ->field(['id', 'chain']) + ->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]]) + ->select(); } $basicPromotes = []; - foreach ($rows as $row) { - $basicPromotes[$row['id']] = $row['parent_id']; + + $basicPromotes = []; + foreach ($ids as $id) { + foreach ($rows as $row) { + $needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/'; + if (strpos($row['chain'], $needChain) !== false) { + $basicPromotes[$row['id']] = $id; + } + } } $map = [ 'isContainSubs' => true, @@ -2619,6 +2629,7 @@ class DownloadController extends BaseController { } $params['begin_time'] = $map['begin_time']; $params['end_time'] = $map['end_time']; + $promoteRepository = new PromoteRepository(); $createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params); $createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params); diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index b2c1a9bb4..d37eaef80 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -130,7 +130,7 @@