测试资源添加审核人

master
ELF 4 years ago
parent 88402dfac0
commit 78caa452b2

@ -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 = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select();
$applyPromotes = index_by_column('id', $applyPromotes); $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 = []; $promotes = [];
if (count($roles) > 0) { if (count($roles) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($roles, 'promote_id')]])->select(); $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; $role = isset($roles[$roleKey]) ? $roles[$roleKey] : null;
$applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null; $applyPromote = $applyPromotes[$batch['apply_promote_id']] ?? null;
$promote = $role ? ($promotes[$role['promote_id']] ?? null) : null; $promote = $role ? ($promotes[$role['promote_id']] ?? null) : null;
$verifyAdmin = $verifyAdmins[$batch['verify_admin_id']] ?? null;
$records[] = [ $records[] = [
'id' => $order['id'], 'id' => $order['id'],
'batch_no' => substr($batch['batch_no'], 14), 'batch_no' => substr($batch['batch_no'], 14),
@ -540,6 +546,7 @@ class TestingResourceController extends ThinkController
'server_name' => $role ? $role['server_name'] : '', 'server_name' => $role ? $role['server_name'] : '',
'role_name' => $role ? $role['role_name'] : '', 'role_name' => $role ? $role['role_name'] : '',
'promote_account' => $promote ? $promote['account'] : '', 'promote_account' => $promote ? $promote['account'] : '',
'verify_admin_username' => $verifyAdmin ? $verifyAdmin['username'] : '系統',
'ref_name' => $order['ref_name'], 'ref_name' => $order['ref_name'],
'ref_amount' => $order['ref_amount'], 'ref_amount' => $order['ref_amount'],
'num' => $order['num'], 'num' => $order['num'],
@ -558,6 +565,7 @@ class TestingResourceController extends ThinkController
'user_account' => '测试账号', 'user_account' => '测试账号',
'role_name' => '角色名称', 'role_name' => '角色名称',
'promote_account' => '所属推广员', 'promote_account' => '所属推广员',
'verify_admin_username' => '审核人',
'ref_name' => '资源名称', 'ref_name' => '资源名称',
'ref_amount' => '资源价值', 'ref_amount' => '资源价值',
'num' => '申请数量', 'num' => '申请数量',

@ -159,7 +159,7 @@ class TestingResourceRepository
$applyPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select(); $applyPromotes = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($batches, 'apply_promote_id')]])->select();
$applyPromotes = index_by_column('id', $applyPromotes); $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 = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $applyAdminIds]])->select();
$applyAdmins = index_by_column('id', $applyAdmins); $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 = M('promote', 'tab_')->field(['id', 'account'])->where(['id' => ['in', array_column($users, 'promote_id')]])->select();
$promotes = index_by_column('id', $promotes); $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 = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $verifyAdminIds]])->select();
$verifyAdmins = index_by_column('id', $verifyAdmins); $verifyAdmins = index_by_column('id', $verifyAdmins);
} }

@ -2724,4 +2724,9 @@ ADD COLUMN `is_site_custom` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否定制
ALTER TABLE `tab_promote_company` ALTER TABLE `tab_promote_company`
ADD COLUMN `site_domain_prefix` varchar(20) NOT NULL DEFAULT '' COMMENT '推广后台域名前缀' AFTER `is_site_custom`; ADD COLUMN `site_domain_prefix` varchar(20) NOT NULL DEFAULT '' COMMENT '推广后台域名前缀' AFTER `is_site_custom`;
ALTER TABLE `tab_promote_company` ALTER TABLE `tab_promote_company`
ADD COLUMN `site_config` varchar(255) NOT NULL DEFAULT '' COMMENT '推广后台网站配置' AFTER `is_site_custom`; 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`;
Loading…
Cancel
Save