diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php index 1946fa047..581ecf923 100644 --- a/Application/Admin/Controller/TestingResourceController.class.php +++ b/Application/Admin/Controller/TestingResourceController.class.php @@ -212,7 +212,8 @@ class TestingResourceController extends ThinkController 'user_account' => '测试账号', 'user_phone' => '手机号', 'promote_account' => '所属推广员', - 'apply_promote_account' => '申请人', + 'apply_username' => '申请人', + 'verify_admin_username' => '审核人', 'apply_amount' => '申请金额', 'provide_amount' => '发放金额', 'verify_status_text' => '审核状态', @@ -230,10 +231,13 @@ class TestingResourceController extends ThinkController $gameId = $params['game_id'] ?? 0; + $admins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select(); + $this->assign('verifyStatusList', TestingResourceRepository::$verifyStatusList); $this->assign('provideStatusList', TestingResourceRepository::$provideStatusList); $this->assign('servers', $gameRepository->getServersByGameId($gameId)); $this->assign('games', $gameRepository->getChoiceGames()); + $this->assign('admins', $admins); $this->assign('count', $count); $this->assign('_page', $pagination); $this->assign('records', $records); @@ -266,7 +270,6 @@ class TestingResourceController extends ThinkController 'user_account' => $role['user_account'], 'server_name' => $role['server_name'], 'role_name' => $role['role_name'], - 'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '', 'promote_account' => $promote['account'], 'ref_name' => $order['ref_name'], 'ref_amount' => $order['ref_amount'], @@ -337,9 +340,10 @@ class TestingResourceController extends ThinkController public function doApply() { $params = I('post.'); + $userAuth = session('user_auth'); try { $testingResourceService = new TestingResourceService(); - $testingResourceService->apply($params); + $testingResourceService->apply($params, null, $userAuth['uid']); return $this->ajaxReturn(['status' => 1, 'message' => '申请成功,等待审核。']); } catch (\Throwable $e) { return $this->ajaxReturn(['status' => 0, 'message' => $e->getMessage()]); @@ -362,11 +366,13 @@ class TestingResourceController extends ThinkController if (count($batches) == 0) { return $this->ajaxReturn(['status' => 0, 'message' => '无未审核批次']); } + $userAuth = session('user_auth'); foreach ($batches as $batch) { if ($status == 1) { - $service->verify($batch); + $service->verify($batch, $userAuth['uid']); } elseif ($status == 2) { - $service->verifyRefuse($batch); + $remark = '审核拒绝'; + $service->verifyRefuse($batch, $remark, $userAuth['uid']); } } return $this->ajaxReturn(['status' => 1, 'message' => '操作成功']); @@ -510,6 +516,10 @@ class TestingResourceController extends ThinkController $applyPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select(); $applyPromotes = index_by_column('id', $applyPromotes); + $verifyAdminIds = array_column($batches, 'verify_admin_id'); + $verifyAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $verifyAdminIds]])->select(); + $verifyAdmins = index_by_column('id', $verifyAdmins); + $promotes = []; if (count($roles) > 0) { $promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($roles, 'promote_id')]])->select(); @@ -525,6 +535,8 @@ class TestingResourceController extends ThinkController $role = isset($roles[$roleKey]) ? $roles[$roleKey] : null; $applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null; $promote = $role ? ($promotes[$role['promote_id']] ?? null) : null; + $verifyAdmin = $verifyAdmins[$batch['verify_admin_id']] ?? null; + $records[] = [ 'id' => $order['id'], 'batch_no' => substr($batch['batch_no'], 14), @@ -533,8 +545,8 @@ class TestingResourceController extends ThinkController 'user_account' => $role ? $role['user_account'] : '', 'server_name' => $role ? $role['server_name'] : '', 'role_name' => $role ? $role['role_name'] : '', - 'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '', 'promote_account' => $promote ? $promote['account'] : '', + 'verify_admin_username' => $verifyAdmin ? $verifyAdmin['username'] : '系統', 'ref_name' => $order['ref_name'], 'ref_amount' => $order['ref_amount'], 'num' => $order['num'], @@ -552,8 +564,8 @@ class TestingResourceController extends ThinkController 'server_name' => '区服名称', 'user_account' => '测试账号', 'role_name' => '角色名称', - 'apply_promote_account' => '申请人', 'promote_account' => '所属推广员', + 'verify_admin_username' => '审核人', 'ref_name' => '资源名称', 'ref_amount' => '资源价值', 'num' => '申请数量', diff --git a/Application/Admin/View/TestingResource/batches.html b/Application/Admin/View/TestingResource/batches.html index 86e067442..9715e6c8c 100644 --- a/Application/Admin/View/TestingResource/batches.html +++ b/Application/Admin/View/TestingResource/batches.html @@ -143,6 +143,16 @@ +
+ +
搜索 导出批次订单 @@ -178,7 +188,8 @@ 测试账号 手机号 所属推广员 - 申请人 + 申请人 + 审核人 申请金额 发放金额 @@ -211,7 +222,8 @@ {$record.user_account} {$record.user_phone} {$record.promote_account} - {$record.apply_promote_account} + {$record.apply_username} + {$record.verify_admin_username} {$record.apply_amount} {$record.provide_amount} diff --git a/Application/Admin/View/TestingResource/orders.html b/Application/Admin/View/TestingResource/orders.html index 7a953cc23..78d0589ae 100644 --- a/Application/Admin/View/TestingResource/orders.html +++ b/Application/Admin/View/TestingResource/orders.html @@ -45,7 +45,6 @@ body { 玩家账号 区服名称 角色名称 - 申请人 资源内容 资源价值 申请数量 @@ -72,7 +71,6 @@ body { {$record.user_account} {$record.server_name} {$record.role_name} - {$record.apply_promote_account} {$record.ref_name} {$record.ref_amount} {$record.num} diff --git a/Application/Base/Repository/TestingResourceRepository.class.php b/Application/Base/Repository/TestingResourceRepository.class.php index 5a0800a9d..cdce1739b 100644 --- a/Application/Base/Repository/TestingResourceRepository.class.php +++ b/Application/Base/Repository/TestingResourceRepository.class.php @@ -88,6 +88,7 @@ class TestingResourceRepository $verifyStatus = $params['verify_status'] ?? -1; $provideStatus = $params['provide_status'] ?? -1; $account = $params['account'] ?? ''; + $adminId = $params['verify_admin_id'] ?? -1; $conditions = []; $conditions['_string'] = '1=1'; @@ -113,6 +114,9 @@ class TestingResourceRepository if ($provideStatus != -1) { $conditions['provide_status'] = $provideStatus; } + if ($adminId != -1) { + $conditions['verify_admin_id'] = $adminId; + } if ($gameId) { $conditions['game_id'] = $gameId; } @@ -136,6 +140,8 @@ class TestingResourceRepository $applyPromotes = []; $users = []; $promotes = []; + $verifyAdmins = []; + $applyAdmins = []; if (count($batches) > 0) { $gameRoleIds = []; foreach ($batches as $batch) { @@ -153,16 +159,25 @@ class TestingResourceRepository $applyPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select(); $applyPromotes = index_by_column('id', $applyPromotes); + $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); + if (count($users) > 0) { $promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($users, 'promote_id')]])->select(); $promotes = index_by_column('id', $promotes); } + $verifyAdminIds = array_column($batches, 'verify_admin_id'); + $verifyAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $verifyAdminIds]])->select(); + $verifyAdmins = index_by_column('id', $verifyAdmins); } return [ 'roles' => $roles, 'applyPromotes' => $applyPromotes, 'users' => $users, 'promotes' => $promotes, + 'verifyAdmins' => $verifyAdmins, + 'applyAdmins' => $applyAdmins, ]; } @@ -173,6 +188,8 @@ class TestingResourceRepository $applyPromotes = $result['applyPromotes']; $users = $result['users']; $promotes = $result['promotes']; + $verifyAdmins = $result['verifyAdmins']; + $applyAdmins = $result['applyAdmins']; $records = []; foreach ($batches as $batch) { @@ -181,6 +198,8 @@ class TestingResourceRepository $user = $users[$batch['user_id']] ?? null; $applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null; $promote = $user && isset($promotes[$user['promote_id']]) ? $promotes[$user['promote_id']] : null; + $verifyAdmin = $verifyAdmins[$batch['verify_admin_id']] ?? null; + $applyAdmin = $applyAdmins[$batch['apply_admin_id']] ?? null; $records[] = [ 'id' => $batch['id'], 'batch_no' => substr($batch['batch_no'], 14), @@ -190,8 +209,9 @@ class TestingResourceRepository 'role_name' => $role ? $role['role_name'] : '--', 'user_account' => $role ?$role['user_account'] : '--', 'user_phone' => $user ? $user['phone'] : '', - 'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '', + 'apply_username' => $applyPromote ? $applyPromote['account'] . '[推广员]' : ($applyAdmin ? $applyAdmin['username'] . '[管理员]' : ''), 'promote_account' => $promote['account'], + 'verify_admin_username' => $batch['verify_status'] == 0 ? '--' : ($verifyAdmin ? $verifyAdmin['username'] : '系統'), // 'history_provide_amount' => 0.00, 'apply_amount' => $batch['apply_amount'], 'provide_amount' => $batch['provide_amount'], diff --git a/Application/Base/Service/TestingResourceService.class.php b/Application/Base/Service/TestingResourceService.class.php index 74b4d04bb..3ff9220af 100644 --- a/Application/Base/Service/TestingResourceService.class.php +++ b/Application/Base/Service/TestingResourceService.class.php @@ -16,7 +16,7 @@ class TestingResourceService $this->repository = new TestingResourceRepository(); } - public function verify($batch) + public function verify($batch, $verifyAdminId = 0) { if ($batch['verify_status'] != 0) { throw new \Exception('审核状态异常'); @@ -36,10 +36,11 @@ class TestingResourceService $batchData['verify_status'] = 1; $batchData['verify_remark'] = '审核成功'; + $batchData['verify_admin_id'] = $verifyAdminId; M('testing_resource_batch', 'tab_')->where(['id' => $batch['id']])->save($batchData); } - public function verifyRefuse($batch, $remark = '审核拒绝') + public function verifyRefuse($batch, $remark = '审核拒绝', $verifyAdminId = 0) { if ($batch['verify_status'] != 0) { throw new \Exception('审核状态异常'); @@ -50,6 +51,7 @@ class TestingResourceService $batchData['update_time'] = time(); $batchData['verify_status'] = 2; $batchData['verify_remark'] = $remark; + $batchData['verify_admin_id'] = $verifyAdminId; M('testing_resource_batch', 'tab_')->where(['id' => $batch['id']])->save($batchData); } @@ -347,7 +349,7 @@ class TestingResourceService return M('testing_binding', 'tab_')->where(['id' => $bindingId])->delete(); } - public function apply($params, $promote = null) + public function apply($params, $promote = null, $adminId = 0) { $gameId = $params['game_id'] ?? 0; $roleId = $params['role_id'] ?? ''; @@ -492,6 +494,7 @@ class TestingResourceService 'role_id' => $roleId, 'server_id' => $serverId, 'apply_promote_id' => $promote ? $promote['id'] : 0, + 'apply_admin_id' => $adminId, 'apply_amount' => $amount, 'provide_status' => 0, 'verify_status' => 0, diff --git a/Application/Home/Controller/TestingResourceController.class.php b/Application/Home/Controller/TestingResourceController.class.php index 9f08d400b..1d8f5bea8 100644 --- a/Application/Home/Controller/TestingResourceController.class.php +++ b/Application/Home/Controller/TestingResourceController.class.php @@ -100,7 +100,6 @@ class TestingResourceController extends BaseController 'user_account' => $role['user_account'], 'server_name' => $role['server_name'], 'role_name' => $role['role_name'], - 'apply_promote_account' => $applyPromote ? $applyPromote['account'] : '', 'promote_account' => $promote['account'], 'ref_name' => $order['ref_name'], 'ref_amount' => $order['ref_amount'], diff --git a/Application/Home/View/default/TestingResource/batches.html b/Application/Home/View/default/TestingResource/batches.html index 919e850d8..919674553 100644 --- a/Application/Home/View/default/TestingResource/batches.html +++ b/Application/Home/View/default/TestingResource/batches.html @@ -119,7 +119,6 @@ 测试账号 手机号 所属推广员 - 申请人 申请金额 发放金额 @@ -147,7 +146,6 @@ {$record.user_account} {$record.user_phone} {$record.promote_account} - {$record.apply_promote_account} {$record.apply_amount} {$record.provide_amount} diff --git a/Application/Home/View/default/TestingResource/orders.html b/Application/Home/View/default/TestingResource/orders.html index 94cc39a71..9f58c39fc 100644 --- a/Application/Home/View/default/TestingResource/orders.html +++ b/Application/Home/View/default/TestingResource/orders.html @@ -106,7 +106,6 @@ 玩家账号 区服名称 角色名称 - 申请人 资源内容 资源价值 申请数量 @@ -129,7 +128,6 @@ {$record.user_account} {$record.server_name} {$record.role_name} - {$record.apply_promote_account} {$record.ref_name} {$record.ref_amount} {$record.num} diff --git a/Data/update.sql b/Data/update.sql index c0b215301..e33ba022f 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2752,4 +2752,9 @@ ADD COLUMN `is_site_custom` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否定制 ALTER TABLE `tab_promote_company` ADD COLUMN `site_domain_prefix` varchar(20) NOT NULL DEFAULT '' COMMENT '推广后台域名前缀' AFTER `is_site_custom`; ALTER TABLE `tab_promote_company` -ADD COLUMN `site_config` varchar(255) NOT NULL DEFAULT '' COMMENT '推广后台网站配置' AFTER `is_site_custom`; \ No newline at end of file +ADD COLUMN `site_config` varchar(255) NOT NULL DEFAULT '' COMMENT '推广后台网站配置' AFTER `is_site_custom`; + +ALTER TABLE `tab_testing_resource_batch` +ADD COLUMN `verify_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '審核管理員ID' AFTER `verify_status`; +ALTER TABLE `tab_testing_resource_batch` +ADD COLUMN `apply_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '申請管理員ID' AFTER `apply_promote_id`;