master
ELF 4 years ago
parent 6f2f588617
commit f0a8b6bc3b

@ -2474,6 +2474,11 @@ function getMarketGroupIds()
return ['11', '12'];
}
function getAdmins()
{
return M('ucenter_member', 'sys_')->select();
}
function getMarketAdmins()
{
$ids = getMarketGroupIds();
@ -2483,6 +2488,9 @@ function getMarketAdmins()
function getMarketAdminsByPromoteIds($promoteIds)
{
if (count($promoteIds) == 0) {
return [];
}
$promotes = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => ['in', $promoteIds]])->select();
$resultMap = [];
foreach ($promotes as $promote) {

@ -218,7 +218,7 @@ class MarketController extends ThinkController
->where(['level' => 1, 'company_id' => $companyId, 'admin_id' => ['gt', 0]])
->select();
$marketAdmins = index_by_column('id', getMarketAdmins());
$marketAdmins = index_by_column('id', getAdmins());
$records = [];
foreach ($promotes as $promote) {

@ -182,7 +182,7 @@ class MemberController extends ThinkController
if(empty($viplevel)) {$viplevel = false;}
}
$adminUsernameList = getAdminUsernameList(array_column($data, 'admin_id'));
$adminList = getMarketAdminsByPromoteIds(array_column($data, 'promote_id'));
foreach ($data as $k => &$v) {
$v['register_type'] = get_registertype($v['register_type']);
if(!$isadmin){
@ -212,7 +212,7 @@ class MemberController extends ThinkController
$v['lock_status'] = get_info_status($v['lock_status'],4);
$v['check_status'] = $v['check_status']==1 ? "正常" :"拉黑";
$v['is_repeat'] = $v['is_repeat']==1 ? "是" :"否";
$v['market_admin_username'] = $adminUsernameList[$v['admin_id']] ?? '无';
$v['market_admin_username'] = isset($adminList[$v['promote_id']]) && $adminList[$v['promote_id']]['admin'] ? $adminList[$v['promote_id']]['admin']['username'] : '无';
}
$field = array(
@ -230,11 +230,10 @@ class MemberController extends ThinkController
));
data2csv($data,"玩家_玩家列表",$field);
}
$adminUsernameList = getAdminUsernameList(array_column($data, 'admin_id'));
$adminList = getMarketAdminsByPromoteIds(array_column($data, 'promote_id'));
foreach ($data as $key=>&$value ) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['market_admin_username'] = $adminUsernameList[$value['admin_id']] ?? '无';
$value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无';
}
//计算总人数

Loading…
Cancel
Save