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

master
chenzhi 5 years ago
commit 62c8c1e54d

@ -1550,6 +1550,7 @@ class ExportController extends Controller
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
fclose($fp);
$this->exportAddOperationLog('Giftbag/record','游戏-礼包管理-领取记录-导出');
exit();
@ -5727,7 +5728,7 @@ class ExportController extends Controller
}
$this->exportAddOperationLog('GameSource/lists','游戏-游戏管理-原包管理-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -5899,7 +5900,121 @@ class ExportController extends Controller
}
$this->exportAddOperationLog('Server/lists','游戏-区服管理-区服列表-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
/**
* 区服预告
* @author 鹿文学
*/
public function server_notice_list() {
$xlsName = $_REQUEST['xlsname'];
if(isset($_REQUEST['show_status'])){
$map['show_status']=$_REQUEST['show_status'];
}
if(isset($_REQUEST['server_version'])){
$map['server_version']=$_REQUEST['server_version'];
}
if(isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])){
$map['start_time'] = array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1));
}elseif(isset($_REQUEST['timestart'])){
$map['start_time']=array('EGT',strtotime($_REQUEST['timestart']));
}elseif(isset($_REQUEST['timeend'])){
$map['start_time']=array('ELT',strtotime($_REQUEST['timeend']));
}
if(isset($_REQUEST['game_name'])){
if($_REQUEST['game_name']=='全部'){
unset($_REQUEST['game_name']);
}else{
$map['server_version']=$_REQUEST['server_version'];
$map['game_name']=['like', "{$_REQUEST['game_name']}%"];
unset($_REQUEST['game_name']);
}
}
if(isset($_REQUEST['server_name'])){
$map['server_name']=$_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
$model = M('ServerNotice','tab_');
if($_REQUEST['type']==2) {
$xlsCell = array(
array('developer_account','开发者账号'),
array('game_name','游戏名称'),
array('server_name','区服名称'),
array('server_version','运营平台'),
array('show_status','显示状态'),
array('start_time','开服时间'),
);
$map['developers'] = array('NEQ',0);
} else {
$xlsCell = array(
array('game_name','游戏名称'),
array('server_name','区服名称'),
array('server_version','运营平台'),
array('show_status','显示状态'),
array('start_time','开服时间'),
);
$map['developers'] = 0;
}
$page = intval($_REQUEST['p']);
$page = $page?$page:1;
$row = $_REQUEST['row']?$_REQUEST['row']:10;
$data=$model
->where($map)
->order('id desc')
->select();
$xlsData = [];
if(is_array($data)){
if($_REQUEST['type']==2) {
foreach($data as $k => $v) {
$v['start_time'] = date('Y-m-d H:i:s',$v['start_time']);
$v['show_status'] = $v['show_status']==1?'已开启':'已关闭';
$v['developer_account'] = get_developer_account($v['developers']);
$v['server_version'] = get_systems_name($v['server_version']);
$xlsData[] = $v;
}
} else {
foreach($data as $k => $v) {
$v['start_time'] = date('Y-m-d H:i:s',$v['start_time']);
$v['show_status'] = $v['show_status']==1?'已开启':'已关闭';
$v['server_version'] = get_systems_name($v['server_version']);
$xlsData[] = $v;
}
}
}
$this->exportAddOperationLog('Server/lists','游戏-区服管理-区服预告-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -6031,7 +6146,7 @@ class ExportController extends Controller
}
$this->exportAddOperationLog('Giftbag/lists','游戏-礼包管理-礼包列表-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}

@ -942,6 +942,8 @@ class GameController extends ThinkController
if ($_POST['warming_amount'] < $_POST['warn_frequency']) {
return $this->error("预警金额频率不能大于预警金额");
}
//获取合作伙伴名称
@$partner_name = M('Partner', 'tab_')->field('partner')->where(['id'=>$_POST['partner_id']])->find()['partner'];
if ($id) {
if (!M('game', 'tab_')->where(['partner_id'=>$_POST['partner_id']])->count()) {
@ -950,6 +952,11 @@ class GameController extends ThinkController
$_POST['upt_time'] = time();
$_POST['operater_id'] = is_login();
$upt = M('partner_divide_warn', 'tab_')->where(['id'=>$id])->save($_POST);
addOperationLog(array(
"op_type"=>1,
"key"=>$partner_name,
"url"=>U("Game/devide_warn_list",array("partner_id"=>$_POST['partner_id']))
));
return $upt ? $this->success("更新成功") : $this->error("更新失败");
} else {
if (M('partner_divide_warn', 'tab_')->where(['partner_id'=>$_POST['partner_id'], 'status'=>1])->find()) {
@ -961,6 +968,13 @@ class GameController extends ThinkController
$_POST['upt_time'] = $_POST['create_time'] = time();
$_POST['operater_id'] = is_login();
$ins = M('partner_divide_warn', 'tab_')->add($_POST);
//操作日志
addOperationLog(array(
"op_type"=>0,
"key"=>$partner_name,
"url"=>U("Game/devide_warn_list",array("partner_id"=>$_POST['partner_id'])),
"menu"=>"游戏-游戏管理-预付款预警管理-新增"
));
return $ins ? $this->success("新增成功") : $this->error("新增失败");
}
} else {
@ -972,6 +986,15 @@ class GameController extends ThinkController
$_POST['operater_id'] = is_login();
$_POST['status'] = 2;
$del = M('partner_divide_warn', 'tab_')->where(['id'=>$id])->save($_POST);
//操作日志
@$partner_id = M('partner_divide_warn', 'tab_')->field('partner_id')->where(['id'=>$id])->find()['partner_id'];
@$partner_name = M('Partner', 'tab_')->field('partner')->where(['id'=>$partner_id])->find()['partner'];
addOperationLog(array(
"op_type"=>2,
"key"=>$partner_name,
"url"=>U("Game/devide_warn_list",array("partner_id"=>$_POST['partner_id'])),
"menu"=>"游戏-游戏管理-预付款预警管理-解除预警"
));
return $del ? $this->success("删除成功") : $this->error("删除失败");
} else {
$warnInfo = M('partner_divide_warn', 'tab_')->where(['id'=>$id])->find();

@ -66,6 +66,13 @@ class GameSourceController extends ThinkController
$d = D('Game_source') -> where($map) -> find();
$source = A('Source', 'Event');
if (empty($d)) {
//添加原包操作日志
$gamename = M("Game","tab_")->where("id = '{$_POST['game_id']}'")->field("game_name")->find()['game_name'];
addOperationLog(array(
"op_type"=>0,
"key"=>$gamename,
"url"=>U("GameSource/lists",array("game_name"=>$gamename))
));
$source -> add_source();
} else {
$type = $_POST['develop_id'] == 0 ? 1 : 2;//判断是添加官方游戏还是开发者游戏
@ -120,6 +127,12 @@ class GameSourceController extends ThinkController
@unlink($value['file_url']);
@unlink($value['description_url']);
@unlink($value['plist_url']);
//操作日志
addOperationLog(array(
"op_type"=>2,
"key"=>$value['game_name'],
"url"=>U("GameSource/lists",array("game_name"=>$value['game_name']))
));
}
if ($Model -> where($map) -> delete()) {
$this -> success('删除成功');
@ -152,6 +165,12 @@ class GameSourceController extends ThinkController
if (empty($d)) {
$source->add_source();
} else {
//更新原包
addOperationLog(array(
"op_type"=>1,
"key"=>$d['game_name'],
"url"=>U("GameSource/lists",array("game_name"=>$d['game_name']))
));
$source->update_source($d['id'], $d['file_name']);
}
} else {

@ -137,6 +137,11 @@ class GiftbagController extends ThinkController {
$data['server_name']=get_server_name($data['server_id']);
$data['novice_num'] = count(explode(',',$data['novice']));
$Model->add($data);
addOperationLog(array(
"op_type"=>0,
"key"=>$data['game_name']."/".$data['giftbag_name'],
"url"=>U("Giftbag/lists",array("giftbag_name"=>$data['giftbag_name']))
));
$this->success('添加礼包成功!', U('lists?model='.$model['name']));
} else {
$this->error($Model->getError());
@ -190,6 +195,11 @@ class GiftbagController extends ThinkController {
$data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']);
$data['novice_num'] = count(explode(',',$data['novice']));
$Model->save($data);
addOperationLog(array(
"op_type"=>1,
"key"=>$data['game_name']."/".$data['giftbag_name'],
"url"=>U("Giftbag/lists",array("giftbag_name"=>$data['giftbag_name']))
));
$this->success('保存'.$model['title'].'成功!', U('lists',array('model'=>$model['name'],'type'=>$_REQUEST['type'])));
} else {
$this->error($Model->getError());

@ -1042,7 +1042,12 @@ class MemberController extends ThinkController
->where($map)
->setField('real_name', $_POST['real_name']);
if ($pro !== false) {
$this->userEditOperationLog($_POST['id']);
addOperationLog(array(
"op_type"=>1,
"key"=>get_user_account($_POST['id']),
"url"=>U("Member/edit",array("id"=>$_POST['id'])),
"menu"=>"用户-玩家组-玩家列表-编辑-真实姓名修改",
));
$this->ajaxReturn(array("status" => 1, "msg" => "真实姓名修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "真实姓名修改失败"));

@ -167,6 +167,11 @@ class PartnerController extends ThinkController
$parseData = array_values($parseData);
if($is_export){
$this->assign('listData', $parseData[0]);
$GetData = $_GET;
unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"游戏-游戏管理-合作方管理-导出"]);
$this->display("export");
die();
}
@ -268,6 +273,12 @@ class PartnerController extends ThinkController
$res = $model->add($save);
if ($res) {
\Think\Log::actionLog('Partner/add', 'partner', $res);
//操作日志
addOperationLog(array(
"op_type"=>0,
"key"=>$partner,
"url"=>U("Partner/lists",array("partner"=>$partner))
));
$this->success('保存成功', U('lists'));
} else {
$this->error('保存失败');
@ -367,6 +378,11 @@ class PartnerController extends ThinkController
$this->error('保存失败');
} else {
\Think\Log::actionLog('Partner/edit', 'partner', $id);
addOperationLog(array(
"op_type"=>1,
"key"=>$partner,
"url"=>U("Partner/lists",array("partner"=>$partner))
));
$this->success('保存成功', U('lists'));
}
} else {
@ -410,12 +426,16 @@ class PartnerController extends ThinkController
$this->error('参数异常');
}
}
@$yres = M($this->modelName, 'tab_')->field("partner")->find($id)['partner'];
$res = M($this->modelName, 'tab_')->delete($id);
if ($res === false) {
$this->error('删除失败');
}
addOperationLog(array(
"op_type"=>2,
"key"=>$yres,
"url"=>U("Partner/lists")
));
$this->success('删除成功', U('lists'));
}

@ -172,6 +172,11 @@ class ServerNoticeController extends ThinkController {
}
$this->error($msg);
}
addOperationLog(array(
"op_type"=>0,
"key"=>$server[$key]['game_name']."/".$server[$key]['server_name'],
"url"=>U("ServerNotice/lists",array("server_name"=>$server[$key]['server_name']))
));
}
$server = $this->array_unset_tt($server);
$res = M('ServerNotice','tab_')->addAll($server);

@ -460,7 +460,14 @@ class ThinkController extends AdminController {
if(CONTROLLER_NAME == "GameType"){
$yres = $Model->where($map)->select();
}
if(CONTROLLER_NAME == "ServerNotice"){
$yres = $Model->where($map)->select();
}
if(CONTROLLER_NAME == "Giftbag"){
$yres = $Model->where($map)->select();
}
if($Model->where($map)->delete()){
if(CONTROLLER_NAME == "GameType"){
foreach ($yres as $k => $v) {
addOperationLog(array(
@ -470,6 +477,24 @@ class ThinkController extends AdminController {
));
}
}
if(CONTROLLER_NAME == "ServerNotice"){
foreach ($yres as $k => $v) {
addOperationLog(array(
"op_type"=>2,
"key"=>$v['game_name']."/".$v['server_name'],
"url"=>U("ServerNotice/lists")
));
}
}
if(CONTROLLER_NAME == "Giftbag"){
foreach ($yres as $k => $v) {
addOperationLog(array(
"op_type"=>2,
"key"=>$v['game_name']."/".$v['giftbag_name'],
"url"=>U("Giftbag/lists")
));
}
}
$this->success('删除成功',$url);
} else {
$this->error('删除失败!');
@ -502,6 +527,13 @@ class ThinkController extends AdminController {
"url"=>U("GameType/lists")
));
}
if(CONTROLLER_NAME == "ServerNotice"){
addOperationLog(array(
"op_type"=>1,
"key"=>$_POST['game_name']."/".$_POST['server_name'],
"url"=>U("ServerNotice/lists",array("server_name"=>$_POST['server_name']))
));
}
$this->success('保存'.$model['title'].'成功!',empty($url)? U('lists?model='.$model['name']):$url);
} else {
$this->error($Model->getError());//,empty($url)? U('lists?model='.$model['name']):$url
@ -541,6 +573,13 @@ class ThinkController extends AdminController {
"url"=>U("GameType/lists")
));
}
if(CONTROLLER_NAME == "ServerNotice"){
addOperationLog(array(
"op_type"=>0,
"key"=>$_POST['game_name']."/".$_POST['server_name'],
"url"=>U("ServerNotice/lists",array("server_name"=>$_POST['server_name']))
));
}
$this->success('添加'.$model['title'].'成功!', empty($url)? U('lists?model='.$model['name']):$url);
} else {
$this->error($Model->getError());

@ -166,6 +166,12 @@ class BatchImportExcelEvent extends Controller{
$this->error($msg);
}
$key++;
//操作日志
addOperationLog(array(
"op_type"=>0,
"key"=>get_game_name($server['A'])."/".$server['B'],
"url"=>U("ServerNotice/lists",array("server_name"=>$server['B']))
));
}
$gameModel = new \Admin\Model\GameModel();

@ -72,6 +72,7 @@ class MemberModel extends Model {
$this->save($data);
$adminData = getAdminData($user['uid']);
$groupId = getGameGroup($user['uid']);
/* 记录登录SESSION和COOKIES */
$auth = array(
@ -86,6 +87,7 @@ class MemberModel extends Model {
$expireTime = 3600;
ini_set('session.gc_maxlifetime', $expireTime);
ini_set('session.cookie_lifetime', $expireTime);
session('user_group_id',$groupId);
session('user_auth', $auth);
session('user_auth_sign', data_auth_sign($auth));
session('user_auth_expire', time());

@ -228,7 +228,7 @@
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/server_list',array_merge(['xlsname'=>'区服管理_区服列表'.((I('type',1)==2)?'_开发者区服':'_官方区服')],I('get.')))}">导出</a>
<a class="sch-btn" href="{:U('Export/server_notice_list',array_merge(['xlsname'=>'区服管理_区服预告'.((I('type',1)==2)?'_开发者区服':'_官方区服')],I('get.')))}">导出</a>
{$_page|default=''}
</div>

@ -32,6 +32,7 @@ function is_login()
if (time() - intval(session('user_auth_expire')) > $expire) { // 过期正则直接去除掉session 并且返回false
session('user_auth', null);
session('user_auth_sign', null);
session('user_group_id', null);
return 0;
} else {
session('user_auth_expire', time() + $expire);
@ -48,7 +49,9 @@ function is_login()
function is_administrator($uid = null)
{
$uid = is_null($uid) ? is_login() : $uid;
return $uid && (intval($uid) === C('USER_ADMINISTRATOR'));
return $uid && (session('user_group_id') == 1)||(intval($uid) === C('USER_ADMINISTRATOR'));
// (intval($uid) === C('USER_ADMINISTRATOR'));
}
/**
@ -1472,4 +1475,12 @@ function getPromoteCompanyName($companyId)
function getGameTypes()
{
return M('game_type', 'tab_')->field('id, type_name')->where(['status' => 1])->select();
}
function getGameGroup($uid) {
$groupId = M('auth_group_access')->field('group_id')->where(['uid'=>$uid])->find();
return $groupId['group_id']?$groupId['group_id']:0;
}
Loading…
Cancel
Save