@ -2078,11 +2078,19 @@ class ExportController extends Controller
array('device_number', '设备号'),
array('game_name', '游戏'),
array('pay_time', '购买时间'),
array('super_money', '超级签金额'),
array('pay_way', '支付方式'),
array('pay_price', '超级签金额'),
);
$xlsData = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->order('id DESC')->select();
$xlsData = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.pay_price,tab_game_supersign.pay_way,tab_game_supersign. order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->order('id DESC')->select();
foreach($xlsData as $k => $v) {
$xlsData[$k]['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']);
if($v['pay_way'] == 0) {
$xlsData[$k]['pay_way'] = '未知';
}elseif ($v['pay_way'] == 1) {
$xlsData[$k]['pay_way'] = '支付宝';
}elseif ($v['pay_way'] == 2) {
$xlsData[$k]['pay_way'] = '微信';
}
}
break;
case 24:
@ -2451,13 +2459,13 @@ class ExportController extends Controller
->select();
// dd($data);
$map2 = array();
$map2 ['fgame_id'] = array('egt', 0);
$map2 ['puid'] = 0;
$map['fgame_id'] = array('egt', 0);
$map['puid'] = 0;
setPowerPromoteIds($map2);
$data2 = $user->field('fgame_id,count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->where($map2)
->group('fgame_id')
->select();
@ -2548,8 +2556,8 @@ class ExportController extends Controller
setPowerPromoteIds($map2);
$data2 = $spend
->field('game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
->where($map2)
->group('game_id')
->select();
@ -2642,8 +2650,8 @@ class ExportController extends Controller
$data2 = $user
->field('register_way,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->where($map2)
->group('register_way')
->select();
@ -2729,9 +2737,9 @@ class ExportController extends Controller
setPowerPromoteIds($map2);
$data2 = $spend
->field('pay_way,
sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
->where($map2)
->group('pay_way')
->select();
@ -2848,7 +2856,7 @@ class ExportController extends Controller
}
//为数据权限添加
setPowerPromoteIds($map, 'u.promote_id');
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
@ -2868,7 +2876,7 @@ class ExportController extends Controller
//官方渠道数据添加
$authorityData = M('user', 'tab_')->alias('u')
->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time,
count(id) as count,
count(id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
@ -3440,9 +3448,9 @@ class ExportController extends Controller
array('mau','MAU'),
);
if (is_file(RUNTIME_PATH.'/access_data_user.txt')) {
if (is_file(RUNTIME_PATH.'/access_data_user.txt')) {
$filetxt = file_get_contents(RUNTIME_PATH.'/access_data_user.txt');
$filetxt = file_get_contents(RUNTIME_PATH.'/access_data_user.txt');
$data = json_decode($filetxt,true);
@ -3475,30 +3483,30 @@ class ExportController extends Controller
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
/**
* ltv统计
* @author 鹿文学
*/
public function ltv($p=1, $start, $end) {
$xlsName = $_REQUEST['xlsname'];
$xlsCell = array(
array('date','日期'),
array('total_amt','充值金额'),
array('user_count','活跃用户'),
array('ltv_1','LTV1'),
array('ltv_2','LTV2'),
array('ltv_3','LTV3'),
array('ltv_4','LTV4'),
array('ltv_5','LTV5'),
array('ltv_6','LTV6'),
array('ltv_7','LTV7'),
array('ltv_14','LTV14'),
array('ltv_30','LTV30'),
);
$start_time = $start = strtotime($start);
/**
* ltv统计
* @author 鹿文学
*/
public function ltv($p=1, $start, $end) {
$xlsName = $_REQUEST['xlsname'];
$xlsCell = array(
array('date','日期'),
array('total_amt','充值金额'),
array('user_count','活跃用户'),
array('ltv_1','LTV1'),
array('ltv_2','LTV2'),
array('ltv_3','LTV3'),
array('ltv_4','LTV4'),
array('ltv_5','LTV5'),
array('ltv_6','LTV6'),
array('ltv_7','LTV7'),
array('ltv_14','LTV14'),
array('ltv_30','LTV30'),
);
$start_time = $start = strtotime($start);
$end_time = $end = strtotime($end) + 86400;
if (is_file(RUNTIME_PATH.'/access_data_ltv.txt')) {
$filetxt = file_get_contents(RUNTIME_PATH.'/access_data_ltv.txt');
@ -3869,21 +3877,21 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
$xlsCell = array(
// array('id','编号'),
// array('id','编号'),
array('order_number','订单号'),
array('title','商品信息'),
// array('game_name','游戏名称'),
// array('server_name','区服名称'),
// array('small_account','小号账户'),
// array('seller_account','卖家账号'),
//// array('phone','卖家手机号'),
// array('game_name','游戏名称'),
// array('server_name','区服名称'),
// array('small_account','小号账户'),
// array('seller_account','卖家账号'),
//// array('phone','卖家手机号'),
array('buyer_account','交易用户'),
array('order_price','售价'),
array('poundage','手续费'),
array('pay_status','状态'),
array('order_time','下单时间'),
// array('pay_time','付款时间'),
// array('send_time','发货时间'),
// array('pay_time','付款时间'),
// array('send_time','发货时间'),
);
if(!empty($_REQUEST['order_number'])) {$extend['order_number']=array('like','%'.$_REQUEST['order_number'].'%');}
@ -3985,9 +3993,9 @@ class ExportController extends Controller
}
if (is_file(RUNTIME_PATH.'/device_data_foldline.txt')) {
if (is_file(RUNTIME_PATH.'/device_data_foldline.txt')) {
$filetxt = file_get_contents(RUNTIME_PATH.'/device_data_foldline.txt');
$filetxt = file_get_contents(RUNTIME_PATH.'/device_data_foldline.txt');
$xlsData = $data[$key];
@ -4336,14 +4344,14 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
// $xlsCell = array(
// array('user_account','玩家账号'),
// array('game_name','游戏名称'),
// array('server_name','游戏区服'),
// array('user_nickname','角色名'),
// array('login_time','登录时间'),
// array('login_ip','最后登录ip'),
// );
// $xlsCell = array(
// array('user_account','玩家账号'),
// array('game_name','游戏名称'),
// array('server_name','游戏区服'),
// array('user_nickname','角色名'),
// array('login_time','登录时间'),
// array('login_ip','最后登录ip'),
// );
$xlsCell = array(
'玩家账号',
@ -4459,12 +4467,12 @@ class ExportController extends Controller
ob_flush();
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
// $xlsData = [];
// $xlsData = [];
exit();
// $this->exportExcel($xlsName, $xlsCell, $xlsData);
// $this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -5887,7 +5895,7 @@ class ExportController extends Controller
$xlsData = [];
// if(is_array($data)){
// if(is_array($data)){
if($_REQUEST['type']==2) {
$data=$model
->where($map)
@ -5936,9 +5944,9 @@ class ExportController extends Controller
$v['grand_account'] = $v['account'];
}
$v['status'] = get_info_status($v['status'],3);
// $v['business_affairs'] = get_business_affairs_account($v['ba_id']);
// $v['grand_account'] = getTopPromote($v['id'])['id'];
// $v['promote_levels'] = get_promote_levels($v['id']);
// $v['business_affairs'] = get_business_affairs_account($v['ba_id']);
// $v['grand_account'] = getTopPromote($v['id'])['id'];
// $v['promote_levels'] = get_promote_levels($v['id']);
switch ($v['ver_status']) {
case '1':
@ -5985,7 +5993,7 @@ class ExportController extends Controller
}
}
// }
// }
$this->exportExcel($xlsName, $xlsCell, $xlsData);
@ -6233,15 +6241,15 @@ class ExportController extends Controller
$model = M('user','tab_');
// $xlsCell = array(
// array('account','玩家账号'),
// array('register_time','注册时间'),
// array('login_time','最后登录时间'),
// array('register_type','注册来源'),
// array('register_ip','注册IP'),
// array('login_time','上次登录'),
// array('top_promote','所属推广员'),
// );
// $xlsCell = array(
// array('account','玩家账号'),
// array('register_time','注册时间'),
// array('login_time','最后登录时间'),
// array('register_type','注册来源'),
// array('register_ip','注册IP'),
// array('login_time','上次登录'),
// array('top_promote','所属推广员'),
// );
$xlsCell = array(
'玩家账号','注册时间','最后登录时间','注册来源','注册IP','上次登录','所属推广员',
);
@ -6321,35 +6329,35 @@ class ExportController extends Controller
fclose($fp);
exit();
// $data = M()->table("({$data}) as a")
// $data = M()->table("({$data}) as a")
// ->field("a.account,a.register_time,a.login_time,a.register_type,a.register_ip,a.top_promote,a.promote_account")
// ->join("left join tab_promote on a.top_promote=tab_promote.id")
// ->order("a.id desc")
// ->select(false);
// var_dump($data);die();
// var_dump($data);die();
// $xlsData = [];
// $xlsData = [];
// if(is_array($data)){
// if(is_array($data)){
//
// foreach($data as $k => $v) {
// foreach($data as $k => $v) {
//
// $v['register_time'] = date('Y-m-d H:i:s',$v['register_time']);
// $v['login_time'] = $v['login_time']>0?date('Y-m-d H:i:s',$v['login_time']):'暂无登录';
// $v['register_time'] = date('Y-m-d H:i:s',$v['register_time']);
// $v['login_time'] = $v['login_time']>0?date('Y-m-d H:i:s',$v['login_time']):'暂无登录';
//
// $v['register_type'] = get_registertype($v['register_type']);
// $v['register_type'] = get_registertype($v['register_type']);
//
// $promote = get_parent_promoteto($v['promote_id']);
// $promote = get_parent_promoteto($v['promote_id']);
//
// $v['top_promote'] = $promote?($v['promote_account'] . get_parent_promoteto($v['promote_id'])):get_promote_name($v['promote_id']);
// $v['top_promote'] = $promote?($v['promote_account'] . get_parent_promoteto($v['promote_id'])):get_promote_name($v['promote_id']);
//
// $xlsData[] = $v;
// $xlsData[] = $v;
//
// }
// }
//
//
// }
// }
$this->exportExcel($xlsName, $xlsCell, $xlsData);
@ -6656,22 +6664,22 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
// $xlsCell = array(
// array('pay_order_number', "订单号"),
// array('pay_time', "充值时间"),
// array('promote_account', L('Subordinate_channel')),
// array('parent_id', "上级推广员"),
// array('user_account', "玩家账号"),
// array('game_name', "游戏名称"),
// array('server_name', L('Game_area_clothing')),
// array('game_player_name', "角色名"),
// array('spend_ip', "充值ip"),
// array('pay_amount', "应付金额"),
// array('cost', "实付金额"),
// array('pay_way', "充值方式"),
// array('promote_id', '商务专员'),
// array('is_check','对账状态')
// );
// $xlsCell = array(
// array('pay_order_number', "订单号"),
// array('pay_time', "充值时间"),
// array('promote_account', L('Subordinate_channel')),
// array('parent_id', "上级推广员"),
// array('user_account', "玩家账号"),
// array('game_name', "游戏名称"),
// array('server_name', L('Game_area_clothing')),
// array('game_player_name', "角色名"),
// array('spend_ip', "充值ip"),
// array('pay_amount', "应付金额"),
// array('cost', "实付金额"),
// array('pay_way', "充值方式"),
// array('promote_id', '商务专员'),
// array('is_check','对账状态')
// );
$xlsCell = array(
"订单号", "充值时间", L('Subordinate_channel'), "上线推广员", "玩家账号", "游戏名称", L('Game_area_clothing'),
@ -6861,22 +6869,22 @@ class ExportController extends Controller
/* 执行查询 */
->select(false);
// $xlsCell = array(
// array('pay_order_number', "订单号"),
// array('pay_time', "充值时间"),
// array('promote_account', L('Subordinate_channel')),
// array('parent_id', "上级推广员"),
// array('user_account', "玩家账号"),
// array('game_name', "游戏名称"),
// array('server_name', L('Game_area_clothing')),
// array('game_player_name', "角色名"),
// array('spend_ip', "充值ip"),
// array('pay_amount', "应付金额"),
// array('cost', "实付金额"),
// array('pay_way', "充值方式"),
// array('promote_id', '商务专员'),
// array('is_check','对账状态')
// );
// $xlsCell = array(
// array('pay_order_number', "订单号"),
// array('pay_time', "充值时间"),
// array('promote_account', L('Subordinate_channel')),
// array('parent_id', "上级推广员"),
// array('user_account', "玩家账号"),
// array('game_name', "游戏名称"),
// array('server_name', L('Game_area_clothing')),
// array('game_player_name', "角色名"),
// array('spend_ip', "充值ip"),
// array('pay_amount', "应付金额"),
// array('cost', "实付金额"),
// array('pay_way', "充值方式"),
// array('promote_id', '商务专员'),
// array('is_check','对账状态')
// );
$xlsData = M()->table("({$xlsData}) as a")
->field("a.pay_order_number,a.pay_time,a.promote_account,tab_promote.account as parent_id,
@ -6890,9 +6898,9 @@ class ExportController extends Controller
if (!$value['account']) {
$value['account'] = "暂无";
}
// $xlsData[$key]['parent_id'] = get_top_promote($value['promote_id'], $value['parent_id']);
// $xlsData[$key]['parent_id'] = get_top_promote($value['promote_id'], $value['parent_id']);
$xlsData[$key]['pay_way'] = get_pay_way($value['pay_way']);
// $xlsData[$key]['promote_id'] = get_promote_business_account($value['promote_id']);
// $xlsData[$key]['promote_id'] = get_promote_business_account($value['promote_id']);
$xlsData[$key]['is_check'] = get_info_status($value['is_check'], 37);
$xlsData[$key]['pay_time'] = date('Y-m-d H:i:s', $value['pay_time']);
mb_convert_variables('GBK', 'UTF-8', $value);