统计日志添加

master
zhengyongxing 5 years ago
parent 81830703f3
commit 3c628fa1c6

@ -2275,5 +2275,35 @@ function getNowDate() {
}
//根据推广员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;
}
?>

@ -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('操作成功');

@ -1242,6 +1242,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 +1271,7 @@ class QueryController extends ThinkController
}
switch ($case) {
case 'deny':
$data = $this->set_withdraw_deny();
break;
case 'upload_transfer_proof':
@ -1302,6 +1316,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'] = '驳回成功';
}

@ -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);
}
}

@ -57,6 +57,18 @@ class UserActionLogController extends AdminController
$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);

@ -1376,3 +1376,18 @@ CREATE TABLE `tab_operation_log` (
-- 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