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