游戏预告-操作日志

master
chenzhi 5 years ago
parent c24b5b9e9c
commit dd0f930105

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

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

@ -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,11 @@ class ThinkController extends AdminController {
if(CONTROLLER_NAME == "GameType"){
$yres = $Model->where($map)->select();
}
if(CONTROLLER_NAME == "ServerNotice"){
$yres = $Model->where($map)->select();
}
if($Model->where($map)->delete()){
if(CONTROLLER_NAME == "GameType"){
foreach ($yres as $k => $v) {
addOperationLog(array(
@ -470,6 +474,15 @@ 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")
));
}
}
$this->success('删除成功',$url);
} else {
$this->error('删除失败!');
@ -502,6 +515,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 +561,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();

@ -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>

Loading…
Cancel
Save