玩家列表新增市场部显示

master
chenzhi 4 years ago
parent 5f6c10bcc1
commit 3b49a29b7a

@ -172,6 +172,8 @@ class MemberController extends ThinkController
}
$showMarketAdmin = session('user_auth')['show_market_admin'];
$showPromote = session('user_auth')['show_promote'];
$departmentList = A("Market",'Event')->getDepartmentNameByMarketType();
if(isset($_REQUEST['export'])){
$isadmin = is_administrator();
//获取等级
@ -215,11 +217,18 @@ class MemberController extends ThinkController
$v['check_status'] = $v['check_status']==1 ? "正常" :"拉黑";
$v['is_repeat'] = $v['is_repeat']==1 ? "是" :"否";
$v['device_type'] = $v['device_type'] == 1 ? "安卓" :($v['device_type'] == 2 ? "IOS" :"未知");
$v['market_admin_username'] = isset($adminList[$v['promote_id']]) && $adminList[$v['promote_id']]['admin'] ? $adminList[$v['promote_id']]['admin']['username'] : '无';
if(isset($adminList[$v['promote_id']]) && $adminList[$v['promote_id']]['admin']){
$v['market_admin_username'] = $adminList[$v['promote_id']]['admin']['username'];
$v['market_admin_department'] = $departmentList[$adminList[$v['promote_id']]['admin']['id']] ?? "无";
}else{
$v['market_admin_username'] = '无';
$v['market_admin_department'] = '无';
}
}
$field = array(
"id"=>"账号ID","account"=>"玩家账号","promote_account"=>"所属推广员","market_admin_username"=>"所属市场专员","balance"=>"账户平台币","recharge_total"=>"累计充值","gold_coin"=>"金币",
"id"=>"账号ID","account"=>"玩家账号","promote_account"=>"所属推广员","market_admin_username"=>"所属市场专员","market_admin_department"=>"所属市场部","balance"=>"账户平台币","recharge_total"=>"累计充值","gold_coin"=>"金币",
"small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间",
"device_number"=>"设备号","device_type"=>"设备类型","is_repeat"=>"去重数据","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态"
);
@ -239,9 +248,19 @@ class MemberController extends ThinkController
));
data2csv($data,"玩家_玩家列表",$field);
}
$adminList = getMarketAdminsByPromoteIds(array_column($data, 'promote_id'));
foreach ($data as $key=>&$value ) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
if(isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin']){
$value['market_admin_username'] = $adminList[$value['promote_id']]['admin']['username'];
$value['market_admin_department'] = $departmentList[$adminList[$value['promote_id']]['admin']['id']] ?? "无";
}else{
$value['market_admin_username'] = '无';
$value['market_admin_department'] = '无';
}
$value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无';
}

@ -18,6 +18,7 @@ class MarketEvent extends Controller
private $gid;
private $isMarket = false;
private $isInit = false;
private $marketDepartment=[];
public function defaultInit()
{
@ -270,5 +271,27 @@ class MarketEvent extends Controller
$adminIds = M("auth_group_access")->where("group_id in ({$group_ids})")->getField('uid',true);
return $adminIds ?? $uid;
}
/**
* 获取部门名称通过市场专员类型
*
* @param string $type id/group_id
* @return array
*/
public function getDepartmentNameByMarketType($type = 'uid')
{
if(isset($this->marketDepartment[$type])){
return $this->marketDepartment[$type];
}
//获取所有公司
$field = "mem.".$type;
$this->marketDepartment[$type] = M("auth_group_access")
->alias("acc")
->where(['gro.department_id'=>['in',$this->MarketDepartmentId]])
->join("sys_member as mem on acc.uid = mem.uid")
->join("sys_auth_group as gro on acc.group_id = gro.id")
->getField("{$field},gro.department_name",true);
return $this->marketDepartment[$type];
}
}

@ -221,6 +221,7 @@
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<th>所属市场专员</th>
<th>所属市场部</th>
<?php endif;?>
<th>
<a class="paixu" data-order="{:I('balance_status',1)}" name="balance_status">
@ -309,6 +310,7 @@
<?php endif;?>
<?php if($showMarketAdmin == 1):?>
<td >{$data.market_admin_username}</td>
<td >{$data.market_admin_department}</td>
<?php endif;?>
<td >{$data.balance}</td>
<td >{$data.recharge_total}</td>

Loading…
Cancel
Save