From d0a61d3e874f1080b4f90a49b4d0fbb2c3b1e315 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 12 Nov 2020 11:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=85=85=E5=80=BC=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=96=B0=E5=A2=9Ecp=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++- .../Controller/ExportController.class.php | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9b3aded7b..968f40c53 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ Uploads/ .vscode /vendor/ /Application/Admin/Controller/device_data_foldline.txt -/Application/Admin/Controller/access_data_launch.txt \ No newline at end of file +/Application/Admin/Controller/access_data_launch.txt +.htaccess +nginx.htaccess diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index fc122fa71..3247934db 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1213,6 +1213,8 @@ class ExportController extends Controller 'payed_time' => '支付时间', 'user_account' => '玩家账号', 'game_name' => '游戏名称', + 'sdk_version' => '设备类型', + 'game_id' => '所属CP', 'promote_account' => L('Subordinate_channel'), '0 as company_name' => '所属推广公司', 'market_admin_id' => '所属市场专员', @@ -1239,6 +1241,26 @@ class ExportController extends Controller $xlsCell = array_values($headers); $fields = array_keys($headers); + // ----获取游戏的基本信息begin + //获取游戏公司 + $cpCompanyDb = M("partner","tab_")->field("id,partner")->order("id asc")->select(); + $cpCompany = []; + foreach ($cpCompanyDb as $index => $cp) { + $cpCompany[$cp['id']]=$cp['partner']; + } + unset($cpCompanyDb); + //获取所有游戏 + $gameDb = M("Game","tab_")->field("id,relation_game_name,partner_id")->order("id asc")->select(); + $gameInfo = []; + foreach ($gameDb as $index => $g) { + $partner_name = $cpCompany[$g['partner_id']]; + $g['partner_name'] = $partner_name; + $gameInfo[$g['id']]=$g; + } + unset($cpCompany); + unset($gameDb); + // ----获取游戏的基本信息end + $csvFileName = $xlsName.'.csv'; //设置好告诉浏览器要下载excel文件的headers @@ -1276,6 +1298,12 @@ class ExportController extends Controller $companys = $companys ? array_column($companys, 'company_name', 'id') : []; foreach($xlsData as $value) { + //游戏信息匹配 + $thisGameInfo = $gameInfo[$value["game_id"]]; + $value['game_name'] =$thisGameInfo['relation_game_name']; + $value['sdk_version'] = $value['sdk_version'] == 1 ? "安卓" : "苹果"; + $value['game_id'] = $thisGameInfo['partner_name']; + $value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? ''); unset($value['promote_id']); $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);