|
|
@ -1213,6 +1213,8 @@ class ExportController extends Controller
|
|
|
|
'payed_time' => '支付时间',
|
|
|
|
'payed_time' => '支付时间',
|
|
|
|
'user_account' => '玩家账号',
|
|
|
|
'user_account' => '玩家账号',
|
|
|
|
'game_name' => '游戏名称',
|
|
|
|
'game_name' => '游戏名称',
|
|
|
|
|
|
|
|
'sdk_version' => '设备类型',
|
|
|
|
|
|
|
|
'game_id' => '所属CP',
|
|
|
|
'promote_account' => L('Subordinate_channel'),
|
|
|
|
'promote_account' => L('Subordinate_channel'),
|
|
|
|
'0 as company_name' => '所属推广公司',
|
|
|
|
'0 as company_name' => '所属推广公司',
|
|
|
|
'market_admin_id' => '所属市场专员',
|
|
|
|
'market_admin_id' => '所属市场专员',
|
|
|
@ -1239,6 +1241,26 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
$xlsCell = array_values($headers);
|
|
|
|
$xlsCell = array_values($headers);
|
|
|
|
$fields = array_keys($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';
|
|
|
|
$csvFileName = $xlsName.'.csv';
|
|
|
|
//设置好告诉浏览器要下载excel文件的headers
|
|
|
|
//设置好告诉浏览器要下载excel文件的headers
|
|
|
@ -1276,6 +1298,12 @@ class ExportController extends Controller
|
|
|
|
$companys = $companys ? array_column($companys, 'company_name', 'id') : [];
|
|
|
|
$companys = $companys ? array_column($companys, 'company_name', 'id') : [];
|
|
|
|
|
|
|
|
|
|
|
|
foreach($xlsData as $value) {
|
|
|
|
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']]] ?? '');
|
|
|
|
$value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? '');
|
|
|
|
unset($value['promote_id']);
|
|
|
|
unset($value['promote_id']);
|
|
|
|
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
|
|
|
|
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
|
|
|
|