From 75284329d318a19fab4b4d733effd7351dda7e0f Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 14 Sep 2021 14:26:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=8F=B8=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E5=B8=82=E5=9C=BA=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/function.php | 6 ++++-- .../Controller/PlatformController.class.php | 18 ++++++++++++++---- .../Admin/View/Platform/promote_pool.html | 2 ++ .../View/Platform/promote_statistics.html | 4 +++- .../View/Platform/promotepay_statistics.html | 4 +++- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index 0ff4826ff..94d41794e 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -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') { - $field = 'id, account, real_name'; + if($field == 'default'){ + $field = 'id, account, real_name'; + } $map['_string'] = '1 = 1'; if ($level > 0) { $map['level'] = $level; diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index b5a3a1254..11bbc07d5 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -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"=>"累计不结算充值", diff --git a/Application/Admin/View/Platform/promote_pool.html b/Application/Admin/View/Platform/promote_pool.html index 237e588bb..7024dddea 100644 --- a/Application/Admin/View/Platform/promote_pool.html +++ b/Application/Admin/View/Platform/promote_pool.html @@ -93,6 +93,7 @@ 推广公司 内外团归属 + 所属市场部 {$vo} @@ -121,6 +122,7 @@ {$data['company_name']} {$data['company_belong']} + {$data['department']} diff --git a/Application/Admin/View/Platform/promote_statistics.html b/Application/Admin/View/Platform/promote_statistics.html index 937bec171..691935f68 100644 --- a/Application/Admin/View/Platform/promote_statistics.html +++ b/Application/Admin/View/Platform/promote_statistics.html @@ -128,6 +128,7 @@ 推广员账号 市场专员 + 所属市场部 游戏 @@ -185,6 +186,7 @@ --> {$data['admin_username']} + {$data['admin_department']} {$data['relation_game_name']} {$data.count} {$data.rand}{$data.rand}{$data.rand}{$data.rand} @@ -196,7 +198,7 @@ - 汇总 + 汇总 {$total.sum_count} --- {$total.sum_today} diff --git a/Application/Admin/View/Platform/promotepay_statistics.html b/Application/Admin/View/Platform/promotepay_statistics.html index 3dd22b267..d4e5ca097 100644 --- a/Application/Admin/View/Platform/promotepay_statistics.html +++ b/Application/Admin/View/Platform/promotepay_statistics.html @@ -142,6 +142,7 @@ 会长账号 当前市场专员 + 所属市场部 游戏 @@ -197,6 +198,7 @@ {$data['company_name']} {$data['promote_account']} {$data['admin_username']} + {$data['admin_department']} {$data['relation_game_name']} {$data.count} {$data.unpay_count|default='0.00'} @@ -208,7 +210,7 @@ - 汇总 + 汇总 {$total.sum_count} {$total.unpay_count} ---