用户行为日志导出修正

master
zhengyongxing 5 years ago
parent 057a51dbeb
commit c58cdd31af

@ -139,7 +139,7 @@ class UserActionLogController extends AdminController
$xlsName = $_REQUEST['xlsname']; $xlsName = $_REQUEST['xlsname'];
$xlsCell = array( $xlsCell = array(
'编号','行为','游戏','玩家','操作时间','操作IP地址' '编号','行为','内容','游戏','玩家','操作时间','操作IP地址'
); );
$map = []; $map = [];
@ -187,7 +187,7 @@ class UserActionLogController extends AdminController
/* 获取频道列表 */ /* 获取频道列表 */
$xlsData = M('user_action_log','tab_') $xlsData = M('user_action_log','tab_')
->field("id,action,game_name,account,create_time,ip,type,remarks") ->field("id,'' as action_title,'' as action_content,game_name,account,create_time,ip,type,remarks,action")
->where($map) ->where($map)
->limit(($i-1)*$perSize ,$perSize) ->limit(($i-1)*$perSize ,$perSize)
->order('create_time DESC')->select(); ->order('create_time DESC')->select();
@ -196,28 +196,70 @@ class UserActionLogController extends AdminController
$value['create_time'] = date("Y-m-d H:i:s", $value['create_time']); $value['create_time'] = date("Y-m-d H:i:s", $value['create_time']);
// $remarks = json_decode($value['remarks'],true);
//// dump($data);
//
// if ($value['type'] == 3) {
// $value['action'] = '登录 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
// } else if ($value['type'] == 4) {
// $value['action'] = '退出 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
// } else if ($value['type'] == 0) {
// $value['action'] = '修改密码';
// } else if ($value['type'] == 1) {
// $value['action'] = '修改/绑定手机号';
// } else if ($value['type'] == 2) {
// $value['action'] = '修改身份信息';
// } else if ($value['type'] == 5) {
// $value['action'] = '上报角色 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
// } else if ($value['type'] == 11) {
// $value['action'] = '修改绑定上级推广员';
// } else {
// $value['action'] = '未知';
// }
$remarks = json_decode($value['remarks'],true); $remarks = json_decode($value['remarks'],true);
// dump($data);
$action = json_decode($value['action'],true);
if ($value['type'] == 3) { if ($value['type'] == 3) {
$value['action'] = '登录 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无'); $value['action_title'] = '登录 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
} else if ($value['type'] == 4) { } else if ($value['type'] == 4) {
$value['action'] = '退出 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无'); $value['action_title'] = '退出 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
} else if ($value['type'] == 0) { } else if ($value['type'] == 0) {
$value['action'] = '修改密码'; $value['action_title'] = '修改密码';
if ($action['account']) {
$value['action_content'] = "-------------------";
} else {
$value['action_content'] = "旧值:{$action['old_data']}<br>新值:{$action['new_data']}";
}
} else if ($value['type'] == 1) { } else if ($value['type'] == 1) {
$value['action'] = '修改/绑定手机号'; $value['action_title'] = '修改/绑定手机号';
$value['action_content'] = "手机号:{$action['phone']}";
} else if ($value['type'] == 2) { } else if ($value['type'] == 2) {
$value['action'] = '修改身份信息'; $value['action_title'] = '修改身份信息';
$value['action_content'] = $action['old_data']?"旧姓名:{$action['old_data']['real_name']} - 新姓名:{$action['new_data']['real_name']}<br>旧身份证:{$action['old_data']['idcard']} - 新身份证:{$action['new_data']['idcard']}":"无历史记录";
} else if ($value['type'] == 5) { } else if ($value['type'] == 5) {
$value['action'] = '上报角色 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无'); $value['action_title'] = '上报角色 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
} else if ($value['type'] == 11) { } else if ($value['type'] == 6) {
$value['action'] = '修改绑定上级推广员'; $value['action_title'] = '点击推广链接下载';
$value['action_content'] = "下载地址:".$value['action'];;
} else if ($value['type'] == 7){
$value['action_title'] = '修改角色名';
$value['action_content'] = "旧值:{$action['old_data']}<br>新值:{$action['new_data']}";
} else if ($value['type'] == 8){
$value['action_title'] = '解绑手机号';
$value['action_content'] = "手机号:{$action['phone']}";
}
else if ($value['type'] == 11) {
$value['action_title'] = '修改绑定上级推广员';
} else { } else {
$value['action'] = '未知'; $value['action_title'] = '未知';
} }
unset($value['type']); unset($value['type']);
unset($value['remarks']); unset($value['remarks']);
unset($value['action']);
mb_convert_variables('GBK', 'UTF-8', $value); mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value); fputcsv($fp, $value);

Loading…
Cancel
Save