Merge branch 'release' of 47.111.118.107:wmtx/platform into release

master
ELF 5 years ago
commit e55d8021ee

@ -315,6 +315,9 @@ function get_pay_way($id=null)
case 15:
return "双乾支付-快捷";
break;
case 17:
return "易宝支付";
break;
}
}
@ -2201,4 +2204,112 @@ function a_array_unique($array){
}
/**
* 操作日志
* array(
* op_type=>操作类型 0:新增1:编辑 2:删除 3:下载,
* op_name=>操作说明 例如:编辑,删除,锁定等,
* url=>需要跳转的url 添加去列表加唯一id编辑直接去编辑页面下载可以重新下载(新开页面),
* key=>关键词:用户的账号,游戏的名词等,
* menu=>非必须,菜单目录,不存在的话按控制器寻找
* )
*/
function addOperationLog($options)
{
$checkarr = ['op_type','url','key'];
foreach ($checkarr as $v) {
if(!array_key_exists($v,$options)){
return false;
}
}
if(!array_key_exists("op_name",$options)){
$options['op_name'] = ($options['op_type'] == 1 ? "编辑" : ($options['op_type'] == 2 ? "删除" :($options['op_type'] == 3 ? "导出" :"新增")));
}
//获取ip
$addarray = [
"op_ip"=>$_SERVER['REMOTE_ADDR'],
'admin_id'=>$_SESSION['onethink_admin']['user_auth']['uid'],
'admin_account'=>$_SESSION['onethink_admin']['user_auth']['username'],
'op_type'=>$options['op_type'],
'op_name'=>$options['op_name'],
'url'=>$options['url'],
'key'=>$options['key'],
'create_time'=>time()
];
//获取菜单名称
if(!array_key_exists("menu",$options)){
$act = CONTROLLER_NAME.'/'.ACTION_NAME;
$arr = [];
$menuname = D("menu")->field('title,pid,group')->where("url = '{$act}'")->find();
if($menuname){
$arr[] = $menuname['title'];
if(!empty($menuname['group'])){
$arr[] = $menuname['group'];
}
getLink($menuname['pid'],$arr);
}
$addarray['menu'] = implode ( "-",array_reverse($arr));
}else{
$addarray['menu'] = $options['menu'];
}
M("OperationLog","tab_")->add($addarray);
}
function getLink($pid=0,&$arr){
if($pid == 0){
return;
}
$menuname = D("menu")->field('title,pid,group')->where("id = '{$pid}'")->find();
if($menuname){
$arr[] = $menuname['title'];
if(!empty($menuname['group'])){
$arr[] = $menuname['group'];
}
if($menuname['pid'] != 0){
getLink($menuname['pid'], $arr);
}
}
}
function getNowDate() {
return date('YmdHis',time());
}
//根据推广员id获取推广员姓名
function getPromoteName($id) {
if (!$id) {
return '';
}
$name = M('promote','tab_')
->where(['id'=>$id])
->find()['account'];
return $name;
}
//根据关联id获取游戏名称
function getrelationGameName($id) {
if (!$id) {
return '';
}
$name = M('game','tab_')
->where(['relation_game_id'=>$id])
->find()['relation_game_name'];
return $name;
}
?>

@ -60,19 +60,20 @@ class AdminController extends Controller {
if ($rule == "admin/index/index"){
//如果首页没有访问权限 自动检测有访问权限的页面然后跳转过去
$qx = M("Auth_group")->table("__AUTH_GROUP__ as ag")
->join("__AUTH_GROUP_ACCESS__ as aga on(ag.id=aga.group_id and aga.uid=".UID.")",'right')
->where("ag.status=1")->limit(1)->select();
if (empty($qx)){
//如果没有任何权限 直接登出
D('Member')->logout();
session('[destroy]');
}
$where['id'] = substr($qx[0]['rules'],0,strpos($qx[0]['rules'], ','));
//$where['id'] = substr($qx[0]['rules'],0,1)
$dz = M("auth_rule")->field('name')->where($where)->find();
$red = substr($dz['name'],6);
redirect(U("$red"));
// $qx = M("Auth_group")->table("__AUTH_GROUP__ as ag")
// ->join("__AUTH_GROUP_ACCESS__ as aga on(ag.id=aga.group_id and aga.uid=".UID.")",'right')
// ->where("ag.status=1")->limit(1)->select();
// if (empty($qx)){
// //如果没有任何权限 直接登出
// D('Member')->logout();
// session('[destroy]');
// }
// $where['id'] = substr($qx[0]['rules'],0,strpos($qx[0]['rules'], ','));
// //$where['id'] = substr($qx[0]['rules'],0,1)
// $dz = M("auth_rule")->field('name')->where($where)->find();
// $red = substr($dz['name'],6);
// redirect(U("$red"));
redirect(U("Admin/Member/user_info"));
}else{
$this->error('未授权访问!');
}
@ -663,4 +664,5 @@ class AdminController extends Controller {
}
}
}

@ -540,4 +540,44 @@ class AjaxController extends ThinkController{
$this->ajaxReturn($data);
}
/**
* 操作日志
* option:
* array(
* op_type=>操作类型 1:编辑 2:删除 3:下载,
* op_name=>操作说明 例如:编辑,删除,锁定等,
* url=>需要跳转的url 添加去列表加唯一id编辑直接去编辑页面下载可以重新下载(新开页面),
* key=>关键词:用户的账号,游戏的名词等,
* menu=>非必须,菜单目录,不存在的话按控制器寻找
* )
* get: 页面get参数
*
* return: 0:错误 1:成功
*/
public function addOperationLog() {
$Get = $_GET['get'];
$option = $_GET['option'];
if (!$option['key']) {
$option['key'] = getNowDate();
}
if (!$option['url']) {
$this->ajaxReturn(['code'=>0]);
}
if (!$option['menu']) {
$this->ajaxReturn(['code'=>0]);
}
if (!$option['op_name']) {
$this->ajaxReturn(['code'=>0]);
}
addOperationLog(['op_type'=>$option['op_type'],'key'=>$option['key'],'op_name'=>$option['op_name'],'url'=>U($option['url'],$Get),'menu'=>$option['menu']]);
$this->ajaxReturn(['code'=>1]);
}
}

@ -220,9 +220,27 @@ class AuthManagerController extends AdminController{
if ( empty($data['id']) ) {
\Think\Log::actionLog('AuthManager/createGroup','authGroup',1);
$r = $AuthGroup->add();
addOperationLog(array(
"op_type"=>0,
"key"=> $_POST['title'],
"url"=>U("AuthManager/index")
));
}else{
\Think\Log::actionLog('AuthManager/editGroup','authGroup',1);
$r = $AuthGroup->save();
//操作日志不传title表示是访问授权
$oparr = array(
"op_type"=>1,
"url"=>U("AuthManager/index")
);
if(empty($_POST['title'])){
$oparr['key'] = M("AuthGroup")->where("id={$data['id']}")->field("title")->find()['title'];
$oparr['menu'] = "用户-管理组-角色权限-访问授权";
}else{
$oparr['key'] =$_POST['title'];
$oparr['menu'] = "用户-管理组-角色权限-基础信息编辑";
}
addOperationLog($oparr);
}
if($r===false){
$this->error('操作失败'.$AuthGroup->getError());
@ -239,9 +257,46 @@ class AuthManagerController extends AdminController{
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
public function changeStatus($method=null){
//操作日志-begin
if(is_array ( $_REQUEST['id'] )){
$ids = implode(",",$_REQUEST['id']);
}else{
$ids = $_REQUEST['id'];
}
$lr = M("AuthGroup")->field('title,status')->where("id in ({$ids})")->select();
$status = 0;
$op_name ='';
$op_type =1;
if ( empty($_REQUEST['id']) ) {
$this->error('请选择要操作的数据!');
}
// 1正常为0禁用,-1为删除'
switch ( strtolower($method) ){
case 'forbidgroup':
$status = 0;
$op_name = "禁用";
break;
case 'resumegroup':
$status = 1;
$op_name = "正常";
break;
case 'deletegroup':
$status = -1;
$op_name = "删除";
$op_type = 2;
break;
}
foreach ($lr as $k => $v) {
if($v['status'] != $status){
addOperationLog(array(
"op_type"=>$op_type,
"key"=> $v['title'],
"menu"=>"用户-管理组-角色权限-".$op_name,
"url"=>U("AuthManager/index")
));
}
}
//操作日志end
switch ( strtolower($method) ){
case 'forbidgroup':
\Think\Log::actionLog('AuthManager/changeStatus?method=forbidGroup','AuthGroup',$_REQUEST['id']);
@ -359,7 +414,22 @@ class AuthManagerController extends AdminController{
if( $gid && !$AuthGroup->checkGroupId($gid)){
$this->error($AuthGroup->error);
}
if ( $AuthGroup->addToGroup($uid,$gid) ){
$flag = false;
try {
$flag = $AuthGroup->addToGroup($uid,$gid);
} catch (\Throwable $th) {
if(empty($AuthGroup->getError())){
$this->error("操作失败:请确认添加的用户是否存在或已经有归属");
}else{
$this->error($AuthGroup->getError());
}
}
if($flag){
addOperationLog(array(
"op_type"=>1,
"key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'],
"url"=>U("AuthManager/index")
));
$this->success('操作成功');
}else{
$this->error($AuthGroup->getError());
@ -384,6 +454,11 @@ class AuthManagerController extends AdminController{
$this->error('用户组不存在');
}
if ( $AuthGroup->removeFromGroup($uid,$gid) ){
addOperationLog(array(
"op_type"=>1,
"key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'],
"url"=>U("AuthManager/index")
));
$this->success('操作成功');
}else{
$this->error('操作失败');
@ -408,6 +483,12 @@ class AuthManagerController extends AdminController{
$this->error($AuthGroup->error);
}
if ( $AuthGroup->addToCategory($gid,$cid) ){
//操作日志
addOperationLog(array(
"op_type"=>1,
"key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'],
"url"=>U("AuthManager/index")
));
$this->success('操作成功',U('index'));
}else{
$this->error('操作失败');
@ -487,6 +568,12 @@ class AuthManagerController extends AdminController{
'data_president'=>$promoteData,
'show_data'=>$show_data
))) {
addOperationLog(array(
"op_type"=>1,
"key"=> M("AuthGroup")->where("id={$gid}")->field("title")->find()['title'],
"menu"=>"用户-管理组-角色权限-数据授权",
"url"=>U("AuthManager/index")
));
$this->success('操作成功',U('AuthManager/index'));
} else {
$this->success('操作成功',U('AuthManager/index'));

@ -2502,6 +2502,12 @@ class ExportController extends Controller
$data[$key]['game_id'] = get_game_name($request['game_id']);
$data[$key]['promote_id'] = get_promote_account($request['promote_id']);
}
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出ARPU分析','url'=>U('stat/userarpu',$GetData),'menu'=>'统计-数据分析-ARPU分析']);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -2625,6 +2631,12 @@ class ExportController extends Controller
'week'=>$total['sum_week'],
'mounth'=>$total['sum_mounth']
);
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出游戏注册统计','url'=>U('Platform/game_statistics',$GetData),'menu'=>'统计-统计-平台统计-游戏注册统计']);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -2719,6 +2731,13 @@ class ExportController extends Controller
'week'=>$total['sum_week'],
'mounth'=>$total['sum_mounth']
);
$GetData = $_GET;
unset($GetData['xlsname']);
unset($GetData['type']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出游戏充值统计','url'=>U('Platform/gamepay_statistics',$GetData),'menu'=>'统计-统计-平台统计-游戏充值统计']);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -2815,6 +2834,13 @@ class ExportController extends Controller
'week'=>$total['sum_week'],
'mounth'=>$total['sum_mounth']
);
$GetData = $_GET;
unset($GetData['xlsname']);
unset($GetData['type']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出注册方式统计','url'=>U('Platform/resway_statistics',$GetData),'menu'=>'统计-统计-平台统计-注册方式统计']);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -2914,6 +2940,13 @@ class ExportController extends Controller
'week'=>$total['sum_week'],
'mounth'=>$total['sum_mounth']
);
$GetData = $_GET;
unset($GetData['xlsname']);
unset($GetData['type']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出充值方式统计','url'=>U('Platform/payway_statistics',$GetData),'menu'=>'统计-统计-平台统计-充值方式统计']);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -3070,6 +3103,12 @@ class ExportController extends Controller
'mounth'=>$total['sum_mounth']
);
$xlsData = $data;
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广员统计','url'=>U('Platform/promote_statistics',$GetData),'menu'=>'统计-统计-推广员统计-推广员注册统计']);
// var_dump($xlsData);die();
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -3202,6 +3241,7 @@ class ExportController extends Controller
'week'=>$total['sum_week'],
'mounth'=>$total['sum_mounth']
);
$xlsData = $data;
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -3294,6 +3334,12 @@ class ExportController extends Controller
['retention_day15', '15日留存'],
['retention_day30', '30日留存'],
];
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出留存率分析','url'=>U('stat/userretention',$GetData),'menu'=>'统计-数据分析-留存率分析']);
$xlsData = $data;
$xlsName = $_REQUEST['xlsname']?$_REQUEST['xlsname']:'留存分析';
$this->exportExcel($xlsName, $xlsCell, $xlsData);
@ -3600,6 +3646,11 @@ class ExportController extends Controller
$xlsData[] = $v;
}
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出用户分析','url'=>U('stat/user',$GetData),'menu'=>'统计-数据分析-用户分析']);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -3734,6 +3785,11 @@ class ExportController extends Controller
$xlsData[] = $v;
}
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出LTV统计','url'=>U('Statistics/ltv',$GetData),'menu'=>'统计-统计-LTV统计']);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -3763,7 +3819,8 @@ class ExportController extends Controller
$xlsData = $data[$key];
$xlsSummary[] = $data['sum'][$key];
} else {
}
else {
$start = I('start',date('Y-m-d',strtotime('-1 day')));
@ -3894,6 +3951,10 @@ class ExportController extends Controller
$xlsSummary[] = $export['sum'][$key];
}
$GetData = $_GET;
unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出总览','url'=>U('Statistics/overview',$GetData),'menu'=>'统计-统计-总览']);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
@ -4116,6 +4177,12 @@ class ExportController extends Controller
);
}
$GetData = $_GET;
unset($GetData['key']);
unset($GetData['hours']);
unset($GetData['name']);
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出应用概况','url'=>U('Stat/device_survey',$GetData),'menu'=>'统计-数据分析-应用概况']);
if (is_file(RUNTIME_PATH.'/device_data_foldline.txt')) {
@ -4125,7 +4192,8 @@ class ExportController extends Controller
$xlsSummary[] = $data['sum'][$key];
} else {
}
else {
$start = I('start',date('Y-m-d',strtotime('-1 day')));
@ -4726,9 +4794,10 @@ class ExportController extends Controller
}
$GetData = $_GET;
unset($GetData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U('User/index',$GetData),'menu'=>'用户-管理组-管理员列表-导出']);
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}

@ -9,10 +9,10 @@ use Org\WeixinSDK\Weixin;
class MemberController extends ThinkController
{
/**
*玩家列表信息
*/
public function user_info($p=0){
//设定默认时间
// if(!array_key_exists("time_start",$_REQUEST) && I('type') != 2){
@ -206,6 +206,14 @@ class MemberController extends ThinkController
"small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间",
"device_number"=>"设备号","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态"
);
//操作日志
unset($_GET['export']);
addOperationLog(array(
"op_type"=>3,
"key"=>getNowDate(),
"url"=>U("Member/user_info",$_GET),
'menu'=>"用户-玩家组-玩家列表-导出"
));
data2csv($data,"玩家_玩家列表",$field);
}
@ -806,6 +814,9 @@ class MemberController extends ThinkController
$res = $member->updateInfo($data);
if ($res !== false) {
\Think\Log::actionLog("Member/edit", "Member", $id);
//操作日志
$this->userEditOperationLog($id);
$this->success("修改成功", U('user_info'));
} else {
$this->error("修改失败");
@ -1011,6 +1022,7 @@ class MemberController extends ThinkController
->where($map)
->setField('phone', $_POST['phone']);
if ($pro !== false) {
$this->userEditOperationLog($_POST['id']);
$this->ajaxReturn(array("status" => 1, "msg" => "手机修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "手机修改失败"));
@ -1030,6 +1042,7 @@ class MemberController extends ThinkController
->where($map)
->setField('real_name', $_POST['real_name']);
if ($pro !== false) {
$this->userEditOperationLog($_POST['id']);
$this->ajaxReturn(array("status" => 1, "msg" => "真实姓名修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "真实姓名修改失败"));
@ -1055,6 +1068,7 @@ class MemberController extends ThinkController
->where($map)
->setField('idcard', $_POST['idcard']);
if ($pro !== false) {
$this->userEditOperationLog($_POST['id']);
$this->ajaxReturn(array("status" => 1, "msg" => "身份证号码修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "身份证号码修改失败"));
@ -1189,12 +1203,20 @@ class MemberController extends ThinkController
$this->assign('show_data_power', $show_data_power);
parent::lists("UserLoginRecord", $p, $extend['map']);
}
//登陆记录删除
public function del($model = null, $ids = null)
{
$map = array();
if (isset($_REQUEST['id'])) {
$map['id'] = $_REQUEST['id'];
//获取玩家账号
addOperationLog(array(
"op_type"=>2,
"key"=>M('user_login_record', 'tab_')->where($map)->field('user_account')->find()['user_account'],
"url"=>U("Member/login_record")
));
$data = M('user_login_record', 'tab_')->where($map)->delete();
\Think\Log::actionLog('Member/del', 'Member', $_REQUEST['id']);
$this->success('删除成功!', U('login_record'), 2);
@ -1208,9 +1230,18 @@ class MemberController extends ThinkController
if (empty($ids)) {
$this->error('请选择要操作的数据!');
}
$ids = implode(",", $ids);
$list = M("user_login_record", "tab_");
$map['id'] = array("in", $ids);
//$map['status'] = 0;
//操作日志
$lr = M("user_login_record", "tab_")->field('user_account')->where($map)->select();
foreach ($lr as $k => $v) {
addOperationLog(array(
"op_type"=>2,
"key"=>$v['user_account'],
"url"=>U("Member/login_record")
));
}
$delete = $list->where($map)->delete();
if ($delete) {
\Think\Log::actionLog('Member/delprovide', 'Member', 1);
@ -1229,7 +1260,7 @@ class MemberController extends ThinkController
{
if ($accounts) $map['account'] = ['in', array_unique(explode("\n", $accounts))];
if ($id) $map['id'] = ['in', array_unique(explode("\n", $id))];
$users = M('user', 'tab_')->where($map)->field('id')->select();
$users = M('user', 'tab_')->where($map)->field('id,lock_status')->select();
if($_POST['lock_remark']){
$res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status,"lock_remark" => $_POST['lock_remark']]);
}else{
@ -1238,6 +1269,9 @@ class MemberController extends ThinkController
if ($res) {
foreach ($users as $item) {
if($item['lock_status'] != $lock_status){
$this->userEditOperationLog($item['id'],"锁定/解锁");
}
\Think\Log::actionLog('Member/lock_status', 'Member', $item['id']);
}
$this->success('操作成功!');
@ -1341,7 +1375,17 @@ class MemberController extends ThinkController
} elseif ($name == 'CACHE_TYPE_HOST' || $name == 'CACHE_TYPE_TIME') {
$this->set_config($name, $value);
}
$Config->where($map)->setField('value', $value);
$res = $Config->where($map)->setField('value', $value);
if($res >0){
//操作日志
addOperationLog(array(
"op_type"=>1,
"key"=>$name,
"url"=>U("Member/blockconfig")
));
}
}
}
S('DB_CONFIG_DATA', null);
@ -1624,7 +1668,7 @@ class MemberController extends ThinkController
if (!empty($tag)) {
$map['tag'] = $tag;
}
$list = M('device_bans', 'tab_')->where($map)->page($p, $row)->select();
$list = M('device_bans', 'tab_')->where($map)->page($p, $row)->order("create_time desc")->select();
$count = M('device_bans', 'tab_')->where($map)->count();
if (!empty($list)) {
foreach ($list as &$item) {
@ -1677,13 +1721,37 @@ class MemberController extends ThinkController
if ($item) {
return $this->error("该禁用已经存在(ID{$item['id']})");
}
M('device_bans', 'tab_')->add(['type' => $type, 'tag' => $tag, 'create_time' => time(), 'operator_id' => is_login()]);
$res = M('device_bans', 'tab_')->add(['type' => $type, 'tag' => $tag, 'create_time' => time(), 'operator_id' => is_login()]);
addOperationLog(array(
"op_type"=>0,
"key"=>$res,
"menu"=>"用户-玩家组-分控列表-新增",
"url"=>U("Member/device_bans_list")
));
}
return $this->success("新增成功", U('Member/device_bans_list'));
} else {
M('device_bans', 'tab_')->where(['id' => $id])->delete();
addOperationLog(array(
"op_type"=>2,
"key"=>$id,
"menu"=>"用户-玩家组-分控列表-解除",
"url"=>U("Member/device_bans_list")
));
return $this->success("解除成功");
}
}
public function userEditOperationLog($id,$op_name = false)
{
$option = array(
"op_type"=>1,
"key"=>get_user_account($id),
"url"=>U("Member/edit",array("id"=>$id))
);
if($op_name){
$option['op_name'] = $op_name;
}
addOperationLog($option);
}
}

@ -0,0 +1,25 @@
<?php
namespace Admin\Controller;
/**
* 订单控制器
*
* @author 鹿文学
*/
class OperationLogController extends ThinkController
{
public function test()
{
$this->addOperationLog(array(
"op_type"=>1,
"op_name"=>"添加用户",
"key"=>"test185",
"url"=>U("Member/user_info",array("user_id"=>252315))
));
}
}

@ -768,6 +768,12 @@ class PlatformController extends ThinkController
$size = $row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
if(isset($_REQUEST['export'])){
$GetData = $_GET;
unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广员充值统计','url'=>U('Platform/promotepay_statistics',$GetData),'menu'=>'统计-统计-推广员统计-推广员充值统计']);
data2csv($data,'推广员充值统计',array(
"promote_account"=>"推广员账号",
"count"=>"累计充值",

@ -139,6 +139,9 @@ class PresidentDepositController extends ThinkController
'status_text' => '押金状态',
'pay_confirm_time' => '押金确认时间',
];
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出会长押金记录','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算管理-奖罚记录管理-导出会长押金记录']);
data2csv($records, '会长押金记录', $field);
exit;
}
@ -200,6 +203,8 @@ class PresidentDepositController extends ThinkController
$record = M('president_deposit', 'tab_')->where(['promote_id' => $promoteId])->find();
$promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find();
if (!$record) {
if ($payType == 0) {
@ -230,6 +235,9 @@ class PresidentDepositController extends ThinkController
$data['create_time'] = time();
$data['update_time'] = time();
M('president_deposit', 'tab_')->add($data);
addOperationLog(['op_type'=>0,'key'=>$promoteData['account'].$amount,'op_name'=>'新增会长押金','url'=>U('PresidentDeposit/edit',['id'=>$promoteId]),'menu'=>'推广员-结算单管理-奖罚记录管理-新增会长押金']);
return $this->success('保存成功', U('PresidentDeposit/records'));
}
@ -262,6 +270,9 @@ class PresidentDepositController extends ThinkController
$data['payer'] = $payer;
$data['update_time'] = time();
M('president_deposit', 'tab_')->where(['promote_id' => $promoteId])->save($data);
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'].$amount,'op_name'=>'编辑会长押金','url'=>U('PresidentDeposit/edit',['id'=>$promoteId]),'menu'=>'推广员-结算单管理-会长押金管理-编辑会长押金']);
return $this->success('保存成功');
}
@ -291,6 +302,11 @@ class PresidentDepositController extends ThinkController
$data['create_time'] = time();
$data['update_time'] = time();
M('president_deposit', 'tab_')->add($data);
$promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find();
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'编辑无需押金','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-无需押金']);
}
$this->ajaxReturn([
'status' => 1,
@ -323,6 +339,20 @@ class PresidentDepositController extends ThinkController
]);
}
$promoteData = M('promote','tab_')
->field('account,amount')
->join('left join tab_president_deposit on tab_president_deposit.promote_id=tab_promote.id')
->where(['tab_promote.id'=>['in', $promoteIds]])
->select();
// dump($promoteData);die();
foreach ($promoteData as $key => $value) {
if ($value['amount']) {
addOperationLog(['op_type'=>1,'key'=>$value['account'].$value['amount'],'op_name'=>'编辑押金已退款','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-押金已退款']);
}
}
M('president_deposit', 'tab_')->where(['promote_id' => ['in', $promoteIds]])->save([
'status' => 2,
@ -358,6 +388,22 @@ class PresidentDepositController extends ThinkController
'message' => '含有非待确认状态记录,不可批量操作'
]);
}
$promoteData = M('promote','tab_')
->field('account,amount')
->join('left join tab_president_deposit on tab_president_deposit.promote_id=tab_promote.id')
->where(['tab_promote.id'=>['in', $promoteIds]])
->select();
// dump($promoteData);die();
foreach ($promoteData as $key => $value) {
if ($value['amount']) {
addOperationLog(['op_type'=>1,'key'=>$value['account'].$value['amount'],'op_name'=>'编辑确认押金到账','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-确认押金到账']);
}
}
M('president_deposit', 'tab_')->where(['promote_id' => ['in', $promoteIds]])->save([
'status' => 1,
'pay_confirm_time' => time(),

@ -202,6 +202,12 @@ class PromoteGameRatioController extends ThinkController
'applicant' => '申请人',
'reviewer' => '确认人',
];
$GetData = $_GET;
unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出公会分成管理','url'=>U('PromoteGameRatio/lists',$GetData),'menu'=>'统计-结算管理-公会分成管理']);
data2csv($records,$csvTitle, $field);
exit;
}
@ -330,6 +336,9 @@ class PromoteGameRatioController extends ThinkController
}
}
}
addOperationLog(['op_type'=>1,'key'=>getPromoteName($promoteGameRatio['promote_id']).getrelationGameName($promoteGameRatio['game_id']),'op_name'=>'修改游戏分成比例申请','url'=>U('PromoteGameRatio/applyRatio',['id'=>$promoteGameRatio['id']]),'menu'=>'推广员-结算单管理-公会分成管理']);
} else {//新增
if (empty($params['promote_id'])) {
$this->error('请选择会长账号');
@ -382,6 +391,9 @@ class PromoteGameRatioController extends ThinkController
}
}
M()->commit();
addOperationLog(['op_type'=>0,'key'=>getPromoteName($promoteId).getrelationGameName($relationGameId),'op_name'=>'生成游戏分成比例申请','url'=>U('PromoteGameRatio/lists'),'menu'=>'推广员-结算单管理-公会分成管理-生成游戏分成比例申请']);
}
$this->success('保存成功', U('lists'));
@ -504,6 +516,7 @@ class PromoteGameRatioController extends ThinkController
$save['remark'] = $remark;
}
$result = D(self::MODEL_NAME)->where($map)->save($save);
// dump($result);die();
if ($result) {
$model = new PromoteGameRatioModel();
$promoteGameRatios = D(self::MODEL_NAME)->where(array('relation_game_id' => ['in', $relationGameIds]))->select();
@ -528,8 +541,12 @@ class PromoteGameRatioController extends ThinkController
$spendSave['selle_ratio'] = $promoteGameRatio['ratio'];
M('spend', 'tab_')->where($spendMap)->save($spendSave);
addOperationLog(['op_type'=>1,'key'=>getPromoteName($promoteGameRatio['promote_id']).getrelationGameName($promoteGameRatio['relation_game_id']),'op_name'=>'审核游戏分成比例订单','url'=>U('PromoteGameRatio/lists'),'menu'=>'推广员-结算单管理-公会分成管理-审核通过']);
}
} else {
addOperationLog(['op_type'=>1,'key'=>getPromoteName($promoteGameRatio['promote_id']).getrelationGameName($promoteGameRatio['relation_game_id']),'op_name'=>'审核游戏分成比例订单','url'=>U('PromoteGameRatio/lists'),'menu'=>'推广员-结算单管理-公会分成管理-审核拒绝']);
}
}
}
$this->success('操作成功');

@ -192,6 +192,9 @@ class QueryController extends ThinkController
'selle_ratio' => '分成比例',
'settlement_amount' => '结算金额',
];
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广结算单','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-推广结算']);
data2csv($data,"推广结算", $field);
exit;
}
@ -296,6 +299,9 @@ class QueryController extends ThinkController
'status_text' => '提现状态',
'respond' => '说明',
];
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广结算记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-推广结算']);
data2csv($data,"推广结算", $field);
exit;
}
@ -1242,6 +1248,19 @@ class QueryController extends ThinkController
$save['status'] = $status;
$res = $withdraw->where($map)->save($save);
if ($res) {
$text = '';
if ($status == 1) {
$text = '汇款通过';
} else if ($status == 2) {
$text = '确认汇款';
}
unset($map['status']);
$withdraw_number = $withdraw->where($map)->select();
foreach ($withdraw_number as $key => $value) {
addOperationLog(['op_type' => 1, 'key' => $value['widthdraw_number'], 'op_name' => $text, 'url' => U('Query/withdraw'), 'menu' => '推广员-结算单管理-推广提现-' . $text]);
}
$this->success('操作成功', U('withdraw'));
} else {
$this->error('操作失败');
@ -1258,6 +1277,7 @@ class QueryController extends ThinkController
}
switch ($case) {
case 'deny':
$data = $this->set_withdraw_deny();
break;
case 'upload_transfer_proof':
@ -1302,6 +1322,14 @@ class QueryController extends ThinkController
$data['status'] = 0;
$data['msg'] = '驳回失败';
} else {
unset($map['status']);
$withdraw_number = $withdraw->where($map)->select();
foreach ($withdraw_number as $key => $value) {
addOperationLog(['op_type'=>1,'key'=>$value['widthdraw_number'],'op_name'=>'驳回汇款请求','url'=>U('Query/withdraw'),'menu'=>'推广员-结算单管理-推广提现-驳回']);
}
$data['status'] = 1;
$data['msg'] = '驳回成功';
}
@ -1810,6 +1838,21 @@ class QueryController extends ThinkController
if ($result === false) {
$this->error('操作失败');
} else {
$promoteAccount = M('promote','tab_')->field('account')->where($map)->select();
foreach($promoteAccount as $key => $value) {
if ($autoStatus == 1) {
$text = '开启自动审核';
} else {
$text = '关闭自动审核';
}
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>$text,'url'=>U('Query/autoReview'),'menu'=>'推广员-结算单管理-推广提现-'.$text]);
}
$this->success('操作成功');
}
} else {

@ -89,6 +89,13 @@ class SettlementController extends ThinkController
$this->assign('action', $action);
if ($delete) {
$res = M('settlement_sheet', 'tab_')->where(['id'=>$id])->delete();
$GetData = $_GET;
unset($GetData['id']);
unset($GetData['delete']);
addOperationLog(['op_type'=>2,'key'=>getNowDate(),'op_name'=>'删除汇总结算单管理','url'=>U('settlement/sheetList',$GetData),'menu'=>'推广员-结算单管理-汇总结算单管理']);
return $res ? $this->success('删除成功', '', true) : $this->success('删除失败', '', true);
}
$this->meta_title = '结算单管理';
@ -388,6 +395,11 @@ class SettlementController extends ThinkController
$notice['create_time'] = time();
$notice['game_id'] = $res;
M('msg', 'tab_')->add($notice);
$GetData = $_POST;
addOperationLog(['op_type'=>0,'key'=>getNowDate(),'op_name'=>'生成汇总结算单','url'=>U('settlement/generateSettlementSheet',$GetData),'menu'=>'推广员-结算单管理-生成汇总结算单']);
return $res ? $this->success('生成成功', true, true) : $this->error('生成失败', true, true);
}
}

@ -319,8 +319,14 @@ class StatementController extends ThinkController
"statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE)
);
if($id == 0){
// var_dump(1);die();
addOperationLog(['op_type'=>0,'key'=>$company['partner'].getNowDate(),'op_name'=>'新增上游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增上游对账单']);
$res = M("statement","tab_")->add($adddata);
}else{
addOperationLog(['op_type'=>1,'key'=>$company['partner'].getNowDate(),'op_name'=>'编辑上游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-编辑上游对账单']);
$res = M("statement","tab_")->where("id = '{$id}'")->save($adddata);
}
if($res !== false){

@ -154,7 +154,11 @@ class StatementMangementController extends ThinkController
$insert['second_party_info'] = json_encode($second_party_info);
$insert['statement_info'] = json_encode($statement_info);
if (!(M('statement','tab_')->where(['ext_field'=>$_REQUEST['ext_field']])->find())) {
addOperationLog(['op_type'=>0,'key'=>$second_party_info['partner'].getNowDate(),'op_name'=>'新增下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增下游对账单']);
M('statement','tab_')->add($insert);
$this->ajaxReturn(['code'=>1, 'msg'=>'生成结算单成功']);
} else {
@ -211,6 +215,9 @@ class StatementMangementController extends ThinkController
$insert['statement_info'] = json_encode($statement_info);
if ((M('statement','tab_')->where(['ext_field'=>$_REQUEST['ext_field']])->save($insert))) {
addOperationLog(['op_type'=>1,'key'=>$second_party_info['partner'].getNowDate(),'op_name'=>'编辑下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增下游对账单']);
$this->ajaxReturn(['code'=>1, 'msg'=>'结算单编辑成功']);
} else {
$this->ajaxReturn(['code'=>0, 'msg'=>'结算单编辑失败']);
@ -323,12 +330,18 @@ class StatementMangementController extends ThinkController
if ($upt === false) {
$this->error('保存失败');
} else {
addOperationLog(['op_type'=>1,'key'=>$data['reward_type'].$data['company_type'].$data['money'],'op_name'=>'修改奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
$this->success('保存成功', U('StatementMangement/rewardManageList'));
}
} else {
$data['create_time'] = time();
$data['creater_id'] = is_login();
$ins = M('reward_record', 'tab_')->add($data);
addOperationLog(['op_type'=>0,'key'=>$data['reward_type'].$data['company_type'].$data['money'],'op_name'=>'新增奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
return $ins ? $this->success('新增成功', U('StatementMangement/rewardManageList')) : $this->error('新增失败');
}
} else {
@ -336,7 +349,13 @@ class StatementMangementController extends ThinkController
$this->assign('games', $games);
if ($id) {
if (I('delete')) {
$rewardRecordData = M('reward_record', 'tab_')->where(['id'=>$id])->find();
$upt = M('reward_record', 'tab_')->where(['id'=>$id])->delete();
addOperationLog(['op_type'=>2,'key'=>$rewardRecordData['reward_type'].$rewardRecordData['company_type'].$rewardRecordData['money'],'op_name'=>'删除奖惩记录','url'=>U('StatementMangement/rewardManageList'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
return $upt ? $this->success('删除成功') : $this->error('删除失败');
} else {
$data = M('reward_record', 'tab_')->where(['id'=>$id])->find();

@ -117,6 +117,13 @@ class TestWhiteListController extends ThinkController
// echo M('test_white_list','tab_')->_sql();die();
if($whiteList) {
//
addOperationLog(array(
"op_type"=>1,
"key"=>$data['account'],
"menu"=>"用户-玩家组-测试白名单-锁定/开启",
"url"=>U("TestWhiteList/lists",array('account'=>$data['account']))
));
$this->ajaxReturn(['status'=>1,'msg'=>"修改白名单成功"]);
} else {
$this->ajaxReturn(['status'=>0,'msg'=>"修改白名单成功"]);
@ -162,7 +169,15 @@ class TestWhiteListController extends ThinkController
$whiteList = M('test_white_list','tab_')->add($data);
if($whiteList) {
//操作日志
addOperationLog(array(
"op_type"=>0,
"key"=>$data['account'],
"menu"=>"用户-玩家组-测试白名单-添加测试账号",
"url"=>U("TestWhiteList/lists",array('account'=>$data['account']))
));
$this->success('添加白名单成功',U('TestWhiteList/lists'));
} else {
$this->error('添加白名单失败');
}
@ -214,6 +229,12 @@ class TestWhiteListController extends ThinkController
$del = M('test_white_list','tab_')->where(['id'=>$userId])->delete();
if ($del) {
addOperationLog(array(
"op_type"=>2,
"key"=>$userWhite['account'],
"menu"=>"用户-玩家组-测试白名单-删除",
"url"=>U("TestWhiteList/lists")
));
$this->ajaxReturn(['status'=>0,'msg'=>"删除成功"]);
} else {
$this->ajaxReturn(['status'=>0,'msg'=>"删除失败"]);

@ -0,0 +1,327 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Admin\Controller;
use User\Api\UserApi;
use Com\Wechat;
use Com\WechatAuth;
/**
* 后台用户控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class UserActionLogController extends AdminController
{
public function index($p = 0) {
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$arraypage = $page;
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$map = [];
if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
}
if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['username']) {
$map['account'] = ['like',"%{$_REQUEST['username']}%"];
}
if ($_REQUEST['game_name']) {
$map['game_name'] = ['like',"%{$_REQUEST['game_name']}%"];
}
$data = M('user_action_log','tab_')->where($map)->page($page,$row)->order('create_time DESC')->select();
foreach($data as $key=>$value) {
$remarks = json_decode($value['remarks'],true);
// dump($data);
if ($value['type'] == 3) {
$data[$key]['action'] = '登录 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
} else if ($value['type'] == 4) {
$data[$key]['action'] = '退出 '.($remarks['server_name']?$remarks['server_name']:'无').'-'.($remarks['role_name']?$remarks['role_name']:'无').'-'.($remarks['role_level']?$remarks['role_level']:'无');
}
}
// die();
$count = M('user_action_log','tab_')->where($map)->order('create_time DESC')->count();
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);//分页
}
$this->assign('data',$data);
$this->display();
}
public function del() {
if (!$_REQUEST['id']) {
$this->ajaxReturn(['status'=>1001]);
}
$map['id'] = $_REQUEST['id'];
$is_del = M('user_action_log','tab_')->where($map)->delete();
if ($is_del) {
$this->ajaxReturn(['status'=>1]);
} else {
$this->ajaxReturn(['status'=>0]);
}
}
public function export() {
$xlsName = $_REQUEST['xlsname'];
$xlsCell = array(
'编号','行为','游戏','玩家','操作时间','操作IP地址'
);
$map = [];
if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
}
if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['username']) {
$map['account'] = ['like',"%{$_REQUEST['username']}%"];
}
if ($_REQUEST['game_name']) {
$map['game_name'] = ['like',"%{$_REQUEST['game_name']}%"];
}
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum=M('user_action_log','tab_')->where($map)->order('create_time DESC')->count();
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
/* 获取频道列表 */
$xlsData = M('user_action_log','tab_')
->field("id,action,game_name,account,create_time,ip")
->where($map)
->limit(($i-1)*$perSize ,$perSize)
->order('create_time DESC')->select();
foreach($xlsData as $key => $value) {
$value['create_time'] = date("Y-m-d H:i:s", $value['create_time']);
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
}
unset($xlsData);//释放变量的内存
//刷新输出缓冲到浏览器
ob_flush();
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
fclose($fp);
exit();
}
public function operateLog($p = 0) {
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$arraypage = $page;
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$map = [];
if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
}
if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['adminname']) {
$map['admin_account'] = ['like',"%{$_REQUEST['adminname']}%"];
}
if ($_REQUEST['op_type']) {
$map['op_type'] = $_REQUEST['op_type'];
}
$data = M('operation_log','tab_')
->where($map)
->page($page,$row)
->order('create_time DESC')
->select();
$count = M('operation_log','tab_')->where($map)->order('create_time DESC')->count();
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);//分页
}
$this->assign('data',$data);
$this->display();
}
public function operateLogDel() {
if (!$_REQUEST['id']) {
$this->ajaxReturn(['status'=>1001]);
}
$map['id'] = $_REQUEST['id'];
$is_del = M('operation_log','tab_')->where($map)->delete();
if ($is_del) {
$this->ajaxReturn(['status'=>1]);
} else {
$this->ajaxReturn(['status'=>0]);
}
}
public function operateLoExport() {
$xlsName = $_REQUEST['xlsname'];
$xlsCell = array(
'编号','位置','类型','操作人','操作时间','操作IP地址'
);
$map = [];
if ($_REQUEST['time_start']&&!$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
}
if (!$_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['time_start']&&$_REQUEST['time_end']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['time_start'])];
$map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
if ($_REQUEST['adminname']) {
$map['admin_account'] = ['like',"%{$_REQUEST['adminname']}%"];
}
if ($_REQUEST['op_type']) {
$map['op_type'] = $_REQUEST['op_type'];
}
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum=M('operation_log','tab_')->where($map)->order('create_time DESC')->count();
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
/* 获取频道列表 */
$xlsData = M('operation_log','tab_')
->field("id,menu,key,op_name,admin_account,create_time,op_ip")
->where($map)
->limit(($i-1)*$perSize ,$perSize)
->order('create_time DESC')->select();
foreach($xlsData as $key => $value) {
$value['menu'] = $value['menu'].'-'.$value['key'];
$value['create_time'] = date("Y-m-d H:i:s", $value['create_time']);
unset($value['key']);
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
}
unset($xlsData);//释放变量的内存
//刷新输出缓冲到浏览器
ob_flush();
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
fclose($fp);
exit();
}
}

@ -211,6 +211,13 @@ class UserController extends AdminController
$res = M('UcenterMember')->where($map1)->setField('status', $status);
$res1 = M('Member')->where($map)->setField('status', $status);
if ($res && $res1) {
$nickname = M('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历
addOperationLog(array(
"op_type"=>1,
"key"=> $nickname,
"menu"=>"用户-管理组-管理员列表-锁定/解锁",
"url"=>U("User/index",array("nickname"=>$nickname))
));
$this->success('更新成功!');
} else {
$this->error('更新失败!');
@ -283,6 +290,13 @@ class UserController extends AdminController
if (!M('Member')->add($user)) {
$this->error('用户添加失败!');
} else {
//操作日志
addOperationLog(array(
"op_type"=>0,
"key"=>$username,
"url"=>U("User/index",array("nickname"=>$username))
));
\Think\Log::actionLog('User/add', 'Member', $uid);
$this->success('用户添加成功!', U('index'));
}
@ -399,6 +413,12 @@ class UserController extends AdminController
if ($smember !== false || $meb || $ag) {
M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password']));
addOperationLog(array(
"op_type"=>1,
"key"=>$_POST['username'],
"url"=>U("User/index",array("nickname"=>$_POST['username']))
));
$this->success('修改成功!', U('User/index'));
} else {
$this->error('修改失败!', U('User/index'));
@ -604,11 +624,17 @@ class UserController extends AdminController
public function delete($id)
{
M()->startTrans();
$nickname = M('Member')->where("uid = '{$id}'")->field("nickname")->find()['nickname'];
$res1 = M('member')->delete($id);
$res2 = M('ucenter_member')->delete($id);
$res3 = M('auth_group_access')->where(array('uid' => $id))->delete();
if ($res1 && $res2 && $res3) {
M()->commit();
addOperationLog(array(
"op_type"=>2,
"key"=> $nickname,
"url"=>U("User/index")
));
$this->success('删除成功');
} else {
M()->rollback();
@ -706,6 +732,16 @@ class UserController extends AdminController
$data = $_POST;
$a = new ToolController();
$re = $a->save($data);
//操作日志
$type = $_REQUEST['type'];
$meta_title = ($_REQUEST['type'] == 1 ? "实名认证" : '防沉迷');
addOperationLog(array(
"op_type"=>1,
"key"=>$type,
"menu"=>"用户-玩家组-实名认证设置-".$meta_title,
"url"=>U("Member/age",array('type'=>$type))
));
\Think\Log::actionLog('User/age', 'User', 1);
$this->success('保存成功');
} else {

@ -185,7 +185,6 @@
</td>
<td style="text-indent:0;">
<br />
<if condition="$data['pay_status'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
@ -198,7 +197,7 @@
</empty>
<tr class="data_summary">
<td>汇总</td>
<td colspan="7">
<td colspan="8">
当页充值:{:array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount'))}
今日充值:{$ttotal}
昨日充值:{$ytotal}

@ -142,7 +142,7 @@
<else/>
<volist name="list_data" id="data">
<tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>
<if condition="$show_data_power eq true ">
{$data.user_account}

@ -169,9 +169,9 @@
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>
</if>
<!-- <if condition="$is_admin eq true ">-->
<!-- <a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>-->
<!-- </if>-->
{$_page|default=''}
</div>
<div class="pro_promot" style="display:none">

@ -260,7 +260,7 @@
</volist>
</empty>
<if condition="$is_admin eq true ">
<if condition="$rule_count_check">
<tr class="data_summary">
<td>汇总</td>
<td colspan="16">
@ -274,7 +274,8 @@
昨日充值:昨日平台所有推广员的累计充值(包括官方渠道)
</td>-->
</tr>
</if>
</if>
</tbody>
</table>
</div>

@ -661,7 +661,12 @@
}else{
times = ydata["date"].split(",");
}
var value = ydata[but].split(",");
if(ydata[but]) {
var value = ydata[but].split(",");
} else {
var value = [0];
}
if(but == 'news'){
var str = `时间,新增用户\n`;
@ -679,6 +684,25 @@
str += times[i]+"\t,"+value[i]+"\t\n";
}
var url = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str);
var optionData = {url:'Statistics/overview',menu:'统计-统计-总览',op_name:'导出总览',op_type:'3'};
$.ajax({
type: "get",
url: '{:U("Ajax/addOperationLog")}',
data: {get:<?php echo json_encode($_GET); ?>,option:optionData},
dataType: "json",
success: function(data){
if(data.code){
layer.msg('保存成功');
}else{
layer.msg('保存失败');
}
}
})
downloadCSV(url, title+'.csv');
});
//导出csv

@ -38,7 +38,7 @@
<div class=" tabcon1711">
<form action="{:U('User/age')}" method="post" class="form-horizontal alipay form_info_ml">
<form action="{:U('User/age',array('type'=>I('type',1)))}" method="post" class="form-horizontal alipay form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>

@ -0,0 +1,247 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">行为日志</h3>
<p class="description_text"></p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" >
<!--游戏类型搜索END-->
<div class="input-list">
<input type="text" id="time-start" name="time_start" class="" value="{:I('time_end')}" placeholder="操作开始时间" autocomplete="off"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="time_end" class="" value="{:I('time_end')}" placeholder="操作结束时间" autocomplete="off"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <if condition="$vo.game_name eq I('game_name')">selected</if> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" name="username" placeholder="玩家" class="" value="{:I('username')}" style="width: 180px"/>&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('UserActionLog/index','model='.$model['name'].'&row='.I('row'),false)}" style="">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th >编号</th>
<th >行为</th>
<th >游戏</th>
<th>玩家</th>
<th >操作时间</th>
<th >操作IP地址</th>
<!-- <th >操作</th>-->
</tr>
</thead>
<!-- 列表 -->
<tbody>
<style>
.data-table thead th, .data-table tbody td{text-align:center}
.data-table tbody td{border-right:1px solid #DDDDDD;}
.d_list .drop-down ul {z-index:999;}
</style>
<if condition = "empty($data)">
<tr>
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data" key="$key">
<tr>
<td >{$data.id}</td>
<td >{$data.action}</td>
<td >{$data.game_name}</td>
<td >{$data.account}</td>
<td >{$data.create_time|date='Y-m-d H:i:s',###}</td>
<td >{$data.ip}</td>
<!-- <td ><a class="confirm del" data-id="{$data.id}">删除</a></td>-->
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn export-btn" href="{:U('UserActionLog/export',array_merge(['xlsname'=>'行为日志'],I('get.')))}" target="_blank">导出</a>
{$_page|default=''}
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U("UserActionLog/index")}');
$(function () {
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
});
</script>
<script type="text/javascript">
$(".select_gallery").select2();
function reload() {
window.location.reload();
}
$(function(){
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
//搜索功能
$("#search").click(function(){
var starttime = $.trim($('#time-start').val());
var endtime = $.trim($('#time-end').val());
if (starttime && endtime && starttime > endtime) {layer.msg('开始时间必须小于等于结束时间');return false;}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.replace(url);
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
$(".del").click(function () {
var del = $(this).data();
layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(){
var url = "/admin.php?s=/UserActionLog/del/id/"+del.id;
layer.load(2);
$.ajax({
url: url,
type: "get",
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.closeAll('loading');
layer.msg("<font style='color: red'>删除成功</font>");
setTimeout(function(){
window.location.reload();
},350);
}else{
alert("删除失败")
}
}
})
}, function(){
});
});
</script>
</block>

@ -0,0 +1,248 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">操作日志</h3>
<p class="description_text"></p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<div class="input-list">
<input type="text" id="time-start" name="time_start" class="" value="{:I('time_end')}" placeholder="操作开始时间" autocomplete="off"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="time_end" class="" value="{:I('time_end')}" placeholder="操作结束时间" autocomplete="off"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="op_type" name="op_type" class="select_gallery" >
<option value="">请选择类型</option>
<option value="1" <if condition="$vo.op_type eq 1">selected</if> >编辑</option>
<option value="2" <if condition="$vo.op_type eq 2">selected</if> >删除</option>
<option value="3" <if condition="$vo.op_type eq 3">selected</if> >下载</option>
</select>
</div>
<div class="input-list">
<input type="text" name="adminname" placeholder="操作人" class="" value="{:I('adminname')}" style="width: 180px"/>&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('UserActionLog/operateLog','model='.$model['name'].'&row='.I('row'),false)}" style="">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th >编号</th>
<th >位置</th>
<th >类型</th>
<th>操作人</th>
<th >操作时间</th>
<th >操作IP地址</th>
<!-- <th >操作</th>-->
</tr>
</thead>
<!-- 列表 -->
<tbody>
<style>
.data-table thead th, .data-table tbody td{text-align:center}
.data-table tbody td{border-right:1px solid #DDDDDD;}
.d_list .drop-down ul {z-index:999;}
</style>
<if condition = "empty($data)">
<tr>
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data" key="$key">
<tr>
<td >{$data.id}</td>
<td ><if condition="$data['op_type'] neq 2"><a href="{$data.url}" target="_blank">{$data.menu}-{$data.key}</a><else/>{$data.menu}-{$data.key}</if></td>
<td >{$data.op_name}</td>
<td >{$data.admin_account}</td>
<td >{$data.create_time|date='Y-m-d H:i:s',###}</td>
<td >{$data.op_ip}</td>
<!-- <td ><a class="confirm del" data-id="{$data.id}">删除</a></td>-->
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn export-btn" href="{:U('UserActionLog/operateLoExport',array_merge(['xlsname'=>'操作日志'],I('get.')))}" target="_blank">导出</a>
{$_page|default=''}
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U("UserActionLog/operateLog")}');
$(function () {
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
});
</script>
<script type="text/javascript">
$(".select_gallery").select2();
function reload() {
window.location.reload();
}
$(function(){
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
//搜索功能
$("#search").click(function(){
var starttime = $.trim($('#time-start').val());
var endtime = $.trim($('#time-end').val());
if (starttime && endtime && starttime > endtime) {layer.msg('开始时间必须小于等于结束时间');return false;}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.replace(url);
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
$(".del").click(function () {
var del = $(this).data();
layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(){
var url = "/admin.php?s=/UserActionLog/operateLogDel/id/"+del.id;
layer.load(2);
$.ajax({
url: url,
type: "get",
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.closeAll('loading');
layer.msg("<font style='color: red'>删除成功</font>");
setTimeout(function(){
window.location.reload();
},350);
}else{
alert("删除失败")
}
}
})
}, function(){
});
});
</script>
</block>

@ -1391,3 +1391,37 @@ CREATE TABLE `tab_promote_action_logs` (
`create_time` CHAR(254) NOT NULL DEFAULT '' COMMENT '创建时间',
PRIMARY KEY (`id`)
) COMMENT='推广员操作日志' COLLATE='utf8mb4_bin';
-- 2020-02-25 chenzhi 后台操作日志
CREATE TABLE `tab_operation_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`op_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '操作类型 1 编辑 2 删除 3下载',
`op_name` varchar(100) COLLATE utf8mb4_bin NOT NULL DEFAULT '0' COMMENT '操作名词',
`url` varchar(1000) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '跳转URL',
`menu` varchar(300) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '菜单目录',
`key` varchar(300) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '关键字唯一表示',
`admin_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作员id',
`admin_account` varchar(30) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '管理员账号',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`op_ip` varchar(16) DEFAULT '0' COMMENT '登陆ip',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 2020-02-25 chenzhi spend表索引优化
ALTER TABLE `tab_spend`
ADD INDEX `game_stayus` (`pay_status`, `pay_game_status`) USING BTREE ;
-- 2020-02-27 zyx 添加行为日志表
CREATE TABLE `tab_user_action_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '玩家用户id',
`account` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '玩家用户名',
`game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id',
`game_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '游戏名称',
`action` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '行为详情',
`type` tinyint(2) NOT NULL DEFAULT 0 COMMENT '行为类型 0:修改密码 1:修改/绑定手机号 2:修改身份信息 3:登录 区服-角色-等级 4:退出 区服-角色-等级',
`ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'ip地址',
`create_time` int(11) NULL DEFAULT 0 COMMENT '创建时间',
`remarks` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
Loading…
Cancel
Save