新增公司所属市场部

master
chenzhi 3 years ago
parent 8a24fb37aa
commit 75284329d3

@ -714,9 +714,11 @@ function getPromoteAccount($promoteId)
}
//获取推广员列表 $level 0-全部 $companyId 推广公司 0-全部
function getPromoteByLevel($level = 0, $companyId = 0)
function getPromoteByLevel($level = 0, $companyId = 0,$field = 'default')
{
if($field == 'default'){
$field = 'id, account, real_name';
}
$map['_string'] = '1 = 1';
if ($level > 0) {
$map['level'] = $level;

@ -161,11 +161,14 @@ class PlatformController extends ThinkController
//获取公司累计注册
$sendData = [];
$departmentName = A("Market",'Event')->getDepartmentNameByMarketType('uid');
foreach($data as $k=>$v){
$promote = getPromoteByLevel(0,$v['id']);
$promote = getPromoteByLevel(0,$v['id'],'id, account, real_name , admin_id');
if(empty($promote)){
$promoteIds = '';
$v["department"] = '无';
}else{
$v["department"] = $departmentName[$promote[0]['admin_id']]??'无';
$promoteIds = implode(",",array_column($promote,"id"));
}
$list = self::setYearList($year);
@ -184,8 +187,6 @@ class PlatformController extends ThinkController
exit();
}
// dump($sendData);die();
$th = array_keys(self::setYearList($year));
$this->assign('th', $th);
$this->assign('list_data', $sendData);
@ -333,7 +334,7 @@ class PlatformController extends ThinkController
private static function setPromotePoolTitle($year,$type="promote")
{
if($type =="promote"){
$range = ["推广公司","内外团归属"];
$range = ["推广公司","内外团归属",'所属市场部'];
$csvFileName = '推广公司汇总.csv';
}else{
$range = ["游戏名称"];
@ -1046,10 +1047,14 @@ class PlatformController extends ThinkController
->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left')
->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : [];
$departmentName = A("Market",'Event')->getDepartmentNameByMarketType('nickname');
$companys = $companys ? array_column($companys, null, 'id') : [];
foreach ($data as &$item) {
$item['company_name'] = $companys[$item['id']]['company_name'] ?? '无';
$item['admin_username'] = $companys[$item['id']]['admin_username'] ?? '无';
$item['admin_department'] =$departmentName[$item['admin_username']] ?? '无';
if($item['id'] == 0){
$item['promote_account'] = C('OFFICIEL_CHANNEL');
} else {
@ -1061,6 +1066,7 @@ class PlatformController extends ThinkController
'company_name' => '公司',
"promote_account"=>"推广员账号",
'admin_username' => '市场专员',
'admin_department' => '所属市场部',
'relation_game_name' => '游戏',
"count"=>"累计注册",
"rand"=>"排行榜",
@ -1316,9 +1322,12 @@ class PlatformController extends ThinkController
->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left')
->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : [];
$companys = $companys ? array_column($companys, null, 'id') : [];
$departmentName = A("Market",'Event')->getDepartmentNameByMarketType('nickname');
foreach ($data as &$item) {
$item['company_name'] = $companys[$item['id']]['company_name'] ?? '无';
$item['admin_username'] = $companys[$item['id']]['admin_username'] ?? '无';
$item['admin_department'] = $departmentName[$item['admin_username']] ?? '无';
}
if(isset($_REQUEST['export'])){
@ -1332,6 +1341,7 @@ class PlatformController extends ThinkController
'company_name' => '公司',
"promote_account"=>"会长账号",
'admin_username' => '当前市场专员',
'admin_department' => '所属市场部',
'relation_game_name' => '游戏',
"count"=>"累计充值",
"unpay_count"=>"累计不结算充值",

@ -93,6 +93,7 @@
<tr>
<th rowspan="2">推广公司</th>
<th rowspan="2">内外团归属</th>
<th rowspan="2">所属市场部</th>
<foreach name="th" item="vo">
<th colspan="3">{$vo}</th>
</foreach>
@ -121,6 +122,7 @@
<tr>
<td>{$data['company_name']}</td>
<td>{$data['company_belong']}</td>
<td>{$data['department']}</td>
<foreach name="data.list" item="item" key="date">
<foreach name="item" item="it" key="type">

@ -128,6 +128,7 @@
<th >推广员账号</th>
<th >市场专员</th>
<th >所属市场部</th>
<th >游戏</th>
@ -185,6 +186,7 @@
</if> -->
</td>
<td>{$data['admin_username']}</td>
<td>{$data['admin_department']}</td>
<td>{$data['relation_game_name']}</td>
<td ><span class='ljzc' data-value="{$data['id']}"><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
@ -196,7 +198,7 @@
</volist>
</empty>
<tr class="data_summary">
<td colspan="4"><span>汇总</span></td>
<td colspan="5"><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>---</td>
<td>{$total.sum_today}</td>

@ -142,6 +142,7 @@
<th >会长账号</th>
<th >当前市场专员</th>
<th >所属市场部</th>
<th >游戏</th>
@ -197,6 +198,7 @@
<td>{$data['company_name']}</td>
<td >{$data['promote_account']}</td>
<td>{$data['admin_username']}</td>
<td>{$data['admin_department']}</td>
<td>{$data['relation_game_name']}</td>
<td ><span class='ljcz' data-value="{$data['promote_id']}"><a>{$data.count}</a></span></td>
<td ><span class='ljcz' data-value="{$data['promote_id']}"><a>{$data.unpay_count|default='0.00'}</a></span></td>
@ -208,7 +210,7 @@
</volist>
</empty>
<tr class="data_summary">
<td colspan="4"><span>汇总</span></td>
<td colspan="5"><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>{$total.unpay_count}</td>
<td>---</td>

Loading…
Cancel
Save