From 17f567e25e2732a0e86b3f69b942989d1e693e22 Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Sat, 12 Mar 2022 19:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=B7=BB=E5=8A=A0=E7=94=B3=E8=AF=B7=E4=BA=BA=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E4=BC=9A=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/TestingResourceController.class.php | 1 + Application/Admin/View/TestingResource/batches.html | 2 ++ .../Repository/TestingResourceRepository.class.php | 11 ++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php index edd749dcc..722e4849e 100644 --- a/Application/Admin/Controller/TestingResourceController.class.php +++ b/Application/Admin/Controller/TestingResourceController.class.php @@ -214,6 +214,7 @@ class TestingResourceController extends ThinkController 'user_account' => '测试账号', 'user_phone' => '手机号', 'promote_account' => '所属推广员', + 'apply_top_username' => '申请人所属会长', 'apply_username' => '申请人', 'verify_admin_username' => '审核人', 'apply_amount' => '申请金额', diff --git a/Application/Admin/View/TestingResource/batches.html b/Application/Admin/View/TestingResource/batches.html index 5ffe4a6f0..308469c17 100644 --- a/Application/Admin/View/TestingResource/batches.html +++ b/Application/Admin/View/TestingResource/batches.html @@ -188,6 +188,7 @@ 测试账号 手机号 所属推广员 + 申请人所属会长 申请人 审核人 @@ -222,6 +223,7 @@ {$record.user_account} {$record.user_phone} {$record.promote_account} + {$record.apply_top_username} {$record.apply_username} {$record.verify_admin_username} diff --git a/Application/Base/Repository/TestingResourceRepository.class.php b/Application/Base/Repository/TestingResourceRepository.class.php index 19a856fc0..ba5ecb08b 100644 --- a/Application/Base/Repository/TestingResourceRepository.class.php +++ b/Application/Base/Repository/TestingResourceRepository.class.php @@ -140,6 +140,7 @@ class TestingResourceRepository { $roles = []; $applyPromotes = []; + $applyTopPromotes = []; $users = []; $promotes = []; $verifyAdmins = []; @@ -158,9 +159,14 @@ class TestingResourceRepository $users = M('user', 'tab_')->field(['id', 'account', 'phone', 'promote_id'])->where(['id' => ['in', array_column($batches, 'user_id')]])->select(); $users = index_by_column('id', $users); - $applyPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select(); + $applyPromotes = M('promote', 'tab_')->field(['id', 'account', 'level1_id'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select(); $applyPromotes = index_by_column('id', $applyPromotes); + if (count($applyPromotes) > 0) { + $applyTopPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($applyPromotes, 'level1_id')]])->select(); + $applyTopPromotes = index_by_column('id', $applyTopPromotes); + } + $applyAdminIds = array_column($batches, 'apply_admin_id'); $applyAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $applyAdminIds]])->select(); $applyAdmins = index_by_column('id', $applyAdmins); @@ -180,6 +186,7 @@ class TestingResourceRepository 'promotes' => $promotes, 'verifyAdmins' => $verifyAdmins, 'applyAdmins' => $applyAdmins, + 'applyTopPromotes' => $applyTopPromotes, ]; } @@ -192,6 +199,7 @@ class TestingResourceRepository $promotes = $result['promotes']; $verifyAdmins = $result['verifyAdmins']; $applyAdmins = $result['applyAdmins']; + $applyTopPromotes = $result['applyTopPromotes']; $records = []; foreach ($batches as $batch) { @@ -211,6 +219,7 @@ class TestingResourceRepository 'role_name' => $role ? $role['role_name'] : '--', 'user_account' => $role ? $this->encodeStr($role['user_account']) : '--', 'user_phone' => $user ? $this->encodeStr($user['phone']) : '', + 'apply_top_username' => $applyPromote ? $this->encodeStr($applyTopPromotes[$applyPromote['level1_id']]['account']) : '--', 'apply_username' => $applyPromote ? $this->encodeStr($applyPromote['account']) . '[推广员]' : ($applyAdmin ? $this->encodeStr($applyAdmin['username']) . '[管理员]' : ''), 'promote_account' => $this->encodeStr($promote['account']), 'verify_admin_username' => $batch['verify_status'] == 0 ? '--' : ($verifyAdmin ? $verifyAdmin['username'] : '系統'),