From 88402dfac0853fd11cc516aba021553b82de4dd1 Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Thu, 3 Dec 2020 18:34:11 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../TestingResourceController.class.php | 18 +++++++++------
.../Admin/View/TestingResource/batches.html | 16 ++++++++++++--
.../Admin/View/TestingResource/orders.html | 2 --
.../TestingResourceRepository.class.php | 22 ++++++++++++++++++-
.../Service/TestingResourceService.class.php | 9 +++++---
.../TestingResourceController.class.php | 1 -
.../View/default/TestingResource/batches.html | 2 --
.../View/default/TestingResource/orders.html | 2 --
8 files changed, 52 insertions(+), 20 deletions(-)
diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php
index 1946fa047..a139edbae 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' => '操作成功']);
@@ -533,7 +539,6 @@ 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'] : '',
'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'],
@@ -552,7 +557,6 @@ class TestingResourceController extends ThinkController
'server_name' => '区服名称',
'user_account' => '测试账号',
'role_name' => '角色名称',
- 'apply_promote_account' => '申请人',
'promote_account' => '所属推广员',
'ref_name' => '资源名称',
'ref_amount' => '资源价值',
diff --git a/Application/Admin/View/TestingResource/batches.html b/Application/Admin/View/TestingResource/batches.html
index 86e067442..09ef58c62 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 ad62b42b0..51a3c47fc 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['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('apply_admin_id', $batches);
+ $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('verify_admin_id', $batches);
+ $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' => $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 9d28e4856..42012e159 100644
--- a/Application/Base/Service/TestingResourceService.class.php
+++ b/Application/Base/Service/TestingResourceService.class.php
@@ -15,7 +15,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('审核状态异常');
@@ -35,10 +35,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('审核状态异常');
@@ -49,6 +50,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);
}
@@ -341,7 +343,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'] ?? '';
@@ -486,6 +488,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} |
From 78caa452b2b67f6824f180b7d7745174216c6b8b Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Fri, 4 Dec 2020 10:12:10 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=A0=B8=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/TestingResourceController.class.php | 8 ++++++++
.../Base/Repository/TestingResourceRepository.class.php | 4 ++--
Data/update.sql | 7 ++++++-
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php
index a139edbae..581ecf923 100644
--- a/Application/Admin/Controller/TestingResourceController.class.php
+++ b/Application/Admin/Controller/TestingResourceController.class.php
@@ -516,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();
@@ -531,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),
@@ -540,6 +546,7 @@ class TestingResourceController extends ThinkController
'server_name' => $role ? $role['server_name'] : '',
'role_name' => $role ? $role['role_name'] : '',
'promote_account' => $promote ? $promote['account'] : '',
+ 'verify_admin_username' => $verifyAdmin ? $verifyAdmin['username'] : '系統',
'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'],
'num' => $order['num'],
@@ -558,6 +565,7 @@ class TestingResourceController extends ThinkController
'user_account' => '测试账号',
'role_name' => '角色名称',
'promote_account' => '所属推广员',
+ 'verify_admin_username' => '审核人',
'ref_name' => '资源名称',
'ref_amount' => '资源价值',
'num' => '申请数量',
diff --git a/Application/Base/Repository/TestingResourceRepository.class.php b/Application/Base/Repository/TestingResourceRepository.class.php
index 51a3c47fc..5abe28999 100644
--- a/Application/Base/Repository/TestingResourceRepository.class.php
+++ b/Application/Base/Repository/TestingResourceRepository.class.php
@@ -159,7 +159,7 @@ 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('apply_admin_id', $batches);
+ $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);
@@ -167,7 +167,7 @@ class TestingResourceRepository
$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('verify_admin_id', $batches);
+ $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);
}
diff --git a/Data/update.sql b/Data/update.sql
index 7a48acc83..25dcc3d3a 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -2724,4 +2724,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`;
\ No newline at end of file
From c8f082cee84324a595559218b43cf7b59a47e5af Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Fri, 4 Dec 2020 10:18:59 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Base/Repository/TestingResourceRepository.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Base/Repository/TestingResourceRepository.class.php b/Application/Base/Repository/TestingResourceRepository.class.php
index 5abe28999..7c152f5d3 100644
--- a/Application/Base/Repository/TestingResourceRepository.class.php
+++ b/Application/Base/Repository/TestingResourceRepository.class.php
@@ -211,7 +211,7 @@ class TestingResourceRepository
'user_phone' => $user ? $user['phone'] : '',
'apply_username' => $applyPromote ? $applyPromote['account'] . '[推广员]' : ($applyAdmin ? $applyAdmin['username'] . '[管理员]' : ''),
'promote_account' => $promote['account'],
- 'verify_admin_username' => $verifyAdmin ? $verifyAdmin['username'] : '系統',
+ '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'],
From b73b502a67f71c5d970afd6e249d78d4d46d0197 Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Tue, 8 Dec 2020 10:43:49 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Admin/View/TestingResource/batches.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Admin/View/TestingResource/batches.html b/Application/Admin/View/TestingResource/batches.html
index 09ef58c62..9715e6c8c 100644
--- a/Application/Admin/View/TestingResource/batches.html
+++ b/Application/Admin/View/TestingResource/batches.html
@@ -144,7 +144,7 @@
-