|
|
@ -140,6 +140,7 @@ class TestingResourceRepository
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$roles = [];
|
|
|
|
$roles = [];
|
|
|
|
$applyPromotes = [];
|
|
|
|
$applyPromotes = [];
|
|
|
|
|
|
|
|
$applyTopPromotes = [];
|
|
|
|
$users = [];
|
|
|
|
$users = [];
|
|
|
|
$promotes = [];
|
|
|
|
$promotes = [];
|
|
|
|
$verifyAdmins = [];
|
|
|
|
$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 = M('user', 'tab_')->field(['id', 'account', 'phone', 'promote_id'])->where(['id' => ['in', array_column($batches, 'user_id')]])->select();
|
|
|
|
$users = index_by_column('id', $users);
|
|
|
|
$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);
|
|
|
|
$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');
|
|
|
|
$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);
|
|
|
@ -180,6 +186,7 @@ class TestingResourceRepository
|
|
|
|
'promotes' => $promotes,
|
|
|
|
'promotes' => $promotes,
|
|
|
|
'verifyAdmins' => $verifyAdmins,
|
|
|
|
'verifyAdmins' => $verifyAdmins,
|
|
|
|
'applyAdmins' => $applyAdmins,
|
|
|
|
'applyAdmins' => $applyAdmins,
|
|
|
|
|
|
|
|
'applyTopPromotes' => $applyTopPromotes,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -192,6 +199,7 @@ class TestingResourceRepository
|
|
|
|
$promotes = $result['promotes'];
|
|
|
|
$promotes = $result['promotes'];
|
|
|
|
$verifyAdmins = $result['verifyAdmins'];
|
|
|
|
$verifyAdmins = $result['verifyAdmins'];
|
|
|
|
$applyAdmins = $result['applyAdmins'];
|
|
|
|
$applyAdmins = $result['applyAdmins'];
|
|
|
|
|
|
|
|
$applyTopPromotes = $result['applyTopPromotes'];
|
|
|
|
|
|
|
|
|
|
|
|
$records = [];
|
|
|
|
$records = [];
|
|
|
|
foreach ($batches as $batch) {
|
|
|
|
foreach ($batches as $batch) {
|
|
|
@ -211,6 +219,7 @@ class TestingResourceRepository
|
|
|
|
'role_name' => $role ? $role['role_name'] : '--',
|
|
|
|
'role_name' => $role ? $role['role_name'] : '--',
|
|
|
|
'user_account' => $role ? $this->encodeStr($role['user_account']) : '--',
|
|
|
|
'user_account' => $role ? $this->encodeStr($role['user_account']) : '--',
|
|
|
|
'user_phone' => $user ? $this->encodeStr($user['phone']) : '',
|
|
|
|
'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']) . '[管理员]' : ''),
|
|
|
|
'apply_username' => $applyPromote ? $this->encodeStr($applyPromote['account']) . '[推广员]' : ($applyAdmin ? $this->encodeStr($applyAdmin['username']) . '[管理员]' : ''),
|
|
|
|
'promote_account' => $this->encodeStr($promote['account']),
|
|
|
|
'promote_account' => $this->encodeStr($promote['account']),
|
|
|
|
'verify_admin_username' => $batch['verify_status'] == 0 ? '--' : ($verifyAdmin ? $verifyAdmin['username'] : '系統'),
|
|
|
|
'verify_admin_username' => $batch['verify_status'] == 0 ? '--' : ($verifyAdmin ? $verifyAdmin['username'] : '系統'),
|
|
|
|