Merge pull request '测试资源申请添加申请人所属会长' (#640) from feature/testing_apply_top_promote into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/640
master
廖金灵 3 years ago
commit 9eebd73dd4

@ -214,6 +214,7 @@ class TestingResourceController extends ThinkController
'user_account' => '测试账号',
'user_phone' => '手机号',
'promote_account' => '所属推广员',
'apply_top_username' => '申请人所属会长',
'apply_username' => '申请人',
'verify_admin_username' => '审核人',
'apply_amount' => '申请金额',

@ -188,6 +188,7 @@
<th>测试账号</th>
<th>手机号</th>
<th>所属推广员</th>
<th>申请人所属会长</th>
<th>申请人</th>
<th>审核人</th>
<!-- <th>发放总金额</th> -->
@ -222,6 +223,7 @@
<td>{$record.user_account}</td>
<td>{$record.user_phone}</td>
<td>{$record.promote_account}</td>
<td>{$record.apply_top_username}</td>
<td>{$record.apply_username}</td>
<td>{$record.verify_admin_username}</td>
<!-- <td>{$record.history_provide_amount}</td> -->

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

Loading…
Cancel
Save