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'] : '系統'),