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

master
chenzhi 5 years ago
commit 61a29307f2

@ -269,6 +269,15 @@ class ApplyController extends ThinkController
public function android_set() public function android_set()
{ {
$data = M('apply','tab_')->where(['id'=>['in',$_REQUEST['ids']]])->select();
foreach ($data as $key => $value) {
addOperationLog(['op_type'=>1,'key'=>$value['game_name'].$value['promote_account'],'op_name'=>'审核游戏分包','url'=>U('Apply/and_lists'),'menu'=>'推广员-推广员管理-游戏分包-审核游戏分包']);
}
$this -> set_status(); $this -> set_status();
} }
@ -403,6 +412,7 @@ class ApplyController extends ThinkController
public function android_del($model = null, $ids = null) public function android_del($model = null, $ids = null)
{ {
\Think\Log ::actionLog('Apply/android_del', 'Apply', 1); \Think\Log ::actionLog('Apply/android_del', 'Apply', 1);
$this -> del($model, $ids); $this -> del($model, $ids);
} }
@ -415,6 +425,7 @@ class ApplyController extends ThinkController
public function del($model = null, $ids = null) public function del($model = null, $ids = null)
{ {
$source = D(self::model_name); $source = D(self::model_name);
$ids || $this -> error("请选择要操作的数据!"); $ids || $this -> error("请选择要操作的数据!");
$id = array_unique((array) $ids); $id = array_unique((array) $ids);
@ -439,6 +450,15 @@ class ApplyController extends ThinkController
} }
$data = M('apply','tab_')->where(['id'=>['in',$_REQUEST['ids']]])->select();
foreach ($data as $key => $value) {
addOperationLog(['op_type'=>1,'key'=>$value['game_name'].$value['promote_account'],'op_name'=>'审核游戏分包','url'=>U('Apply/and_lists'),'menu'=>'推广员-推广员管理-游戏分包-审核游戏分包']);
}
$model = M('Model') -> getByName(self::model_name); /*通过Model名称获取Model完整信息*/ $model = M('Model') -> getByName(self::model_name); /*通过Model名称获取Model完整信息*/
parent ::del($model["id"], $ids); parent ::del($model["id"], $ids);
} }
@ -468,6 +488,15 @@ class ApplyController extends ThinkController
$successNum ++; $successNum ++;
} }
} }
$data = M('apply','tab_')->where(['id'=>['in',$ids]])->select();
foreach ($data as $key => $value) {
addOperationLog(['op_type'=>1,'key'=>$value['game_name'].$value['promote_account'],'op_name'=>'打包游戏分包','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-游戏分包-打包游戏分包']);
}
$msg = "已加入打包队列,刷新此页面可查看当前打包状态;\r\n加入成功" . $successNum . "个。" . "失败:" . $errorNuem . "个"; $msg = "已加入打包队列,刷新此页面可查看当前打包状态;\r\n加入成功" . $successNum . "个。" . "失败:" . $errorNuem . "个";
$this -> success($msg, U('Apply/and_lists', array('p' => $p, 'type' => $type))); $this -> success($msg, U('Apply/and_lists', array('p' => $p, 'type' => $type)));
exit; exit;
@ -898,6 +927,12 @@ class ApplyController extends ThinkController
$res = M('config') -> where(array('name' => $config_key)) -> save($config); $res = M('config') -> where(array('name' => $config_key)) -> save($config);
S('DB_CONFIG_DATA', null); S('DB_CONFIG_DATA', null);
if ($res !== false) { if ($res !== false) {
if ($val == 0) {
addOperationLog(['op_type'=>1,'key'=>getNowDate(),'op_name'=>'关闭自动审核','url'=>U('Apply/and_lists'),'menu'=>'推广员-推广员管理-游戏分包-关闭自动审核']);
} else if ($val == 1) {
addOperationLog(['op_type'=>1,'key'=>getNowDate(),'op_name'=>'开启自动审核','url'=>U('Apply/and_lists'),'menu'=>'推广员-推广员管理-游戏分包-开启自动审核']);
}
$this -> success('操作成功'); $this -> success('操作成功');
} else { } else {
$this -> error('操作失败'); $this -> error('操作失败');

@ -6253,6 +6253,11 @@ class ExportController extends Controller
// } // }
$getData = $_GET;
unset($getData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广员','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-导出推广员']);
$this->exportExcel($xlsName, $xlsCell, $xlsData); $this->exportExcel($xlsName, $xlsCell, $xlsData);
@ -6402,6 +6407,10 @@ class ExportController extends Controller
} }
$getData = $_GET;
unset($getData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出游戏分包','url'=>U('Apply/and_lists',$getData),'menu'=>'推广员-推广员管理-推广员列表-导出游戏分包']);
$this->exportExcel($xlsName, $xlsCell, $xlsData); $this->exportExcel($xlsName, $xlsCell, $xlsData);
@ -6585,6 +6594,12 @@ class ExportController extends Controller
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
} }
fclose($fp); fclose($fp);
$getData = $_GET;
unset($getData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广补链','url'=>U('Mend/lists',$getData),'menu'=>'推广员-推广员管理-推广员列表-导出推广补链']);
exit(); exit();
// $data = M()->table("({$data}) as a") // $data = M()->table("({$data}) as a")
@ -8229,6 +8244,12 @@ class ExportController extends Controller
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。 flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
} }
fclose($fp); fclose($fp);
$getData = $_GET;
unset($getData['xlsname']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出资源发放','url'=>U('Support/lists',$getData),'menu'=>'推广员-推广员管理-推广员列表-导出资源发放']);
exit(); exit();
} }

@ -148,6 +148,11 @@ class MendController extends ThinkController {
} }
$res = $promoteService->addShiftTask($params); $res = $promoteService->addShiftTask($params);
if($res['status']){ if($res['status']){
$userData = M('user','tab_')->field('account')->where(['id'=>$create['user_id']])->find();
addOperationLog(['op_type'=>1,'key'=>$userData['account'],'op_name'=>'编辑推广补链','url'=>U('Mend/edit',['id'=>$create['user_id']]),'menu'=>'推广员-推广员管理-推广补链-编辑推广补链']);
$this->success('补链成功', U('lists'), 2); $this->success('补链成功', U('lists'), 2);
}else{ }else{
$this->error($res['msg']); $this->error($res['msg']);
@ -268,6 +273,9 @@ class MendController extends ThinkController {
$id = I('id'); $id = I('id');
$status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]); $status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
if ($status) { if ($status) {
addOperationLog(['op_type'=>1,'key'=>$id,'op_name'=>'取消补链','url'=>U('Mend/shiftInfo',['id'=>$id]),'menu'=>'推广员-推广员管理-推广补链-取消补链']);
$this->ajaxReturn(array("status"=>1,"url"=> U('lists'))); $this->ajaxReturn(array("status"=>1,"url"=> U('lists')));
} else { } else {
$this->ajaxReturn(array("status"=>0,"url"=> U('lists'))); $this->ajaxReturn(array("status"=>0,"url"=> U('lists')));

@ -198,6 +198,12 @@ class PromoteCompanyController extends ThinkController
$this->assign('count', $count); $this->assign('count', $count);
$this->assign('promotecount', $promotecount); $this->assign('promotecount', $promotecount);
if($is_export){ if($is_export){
$getData = $_GET;
unset($getData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广公司','url'=>U('PromoteCompany/lists'),'menu'=>'推广员-推广员管理-推广公司管理-导出推广公司']);
//导出 //导出
$this->display("export"); $this->display("export");
die(); die();
@ -242,6 +248,9 @@ class PromoteCompanyController extends ThinkController
} }
$res = $model->add($save); $res = $model->add($save);
if ($res) { if ($res) {
addOperationLog(['op_type'=>0,'key'=>$company_name,'op_name'=>'新增推广公司','url'=>U('PromoteCompany/lists'),'menu'=>'推广员-推广员管理-推广公司管理-新增推广公司']);
\Think\Log::actionLog('PromoteCompany/add', 'partner', $res); \Think\Log::actionLog('PromoteCompany/add', 'partner', $res);
$array=array( $array=array(
"info"=>"添加成功", "info"=>"添加成功",
@ -307,6 +316,9 @@ class PromoteCompanyController extends ThinkController
$res = $model->save($save); $res = $model->save($save);
if ($res) { if ($res) {
\Think\Log::actionLog('PromoteCompany/edit', 'partner', $res); \Think\Log::actionLog('PromoteCompany/edit', 'partner', $res);
addOperationLog(['op_type'=>1,'key'=>$_POST['company_name'],'op_name'=>'编辑推广公司','url'=>U('PromoteCompany/lists'),'menu'=>'推广员-推广员管理-推广公司管理-编辑推广公司']);
$array=array( $array=array(
"info"=>"修改成功", "info"=>"修改成功",
"status"=>1 "status"=>1
@ -368,12 +380,19 @@ class PromoteCompanyController extends ThinkController
unlink("./".$v['file_path']); unlink("./".$v['file_path']);
} }
} }
$companyData = M('promote_company','tab_')->field('company_name')->where(['id'=>$_REQUEST['id']])->find();
$res = $model->delete($id); $res = $model->delete($id);
//删除对应的推广员 //删除对应的推广员
if ($res === false) { if ($res === false) {
$this->error('删除失败'); $this->error('删除失败');
} }
// echo M()->_sql();die();
addOperationLog(['op_type'=>2,'key'=>$companyData['company_name'],'op_name'=>'删除推广公司','url'=>U('PromoteCompany/lists'),'menu'=>'推广员-推广员管理-推广公司管理-删除推广公司']);
$this->success('删除成功', U('lists')); $this->success('删除成功', U('lists'));
} }
//处理上传图片 //处理上传图片

@ -269,6 +269,9 @@ class PromoteController extends ThinkController
$ba = new \Admin\Model\BusinessAffairsModel(); $ba = new \Admin\Model\BusinessAffairsModel();
$ba->add_child($_REQUEST['ba_id'],$res); $ba->add_child($_REQUEST['ba_id'],$res);
} */ } */
addOperationLog(['op_type'=>0,'key'=>$account,'op_name'=>'新增推广员','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-新增推广员']);
session('user_auth_promote_ids', null); session('user_auth_promote_ids', null);
$this->success("添加成功", U('lists')); $this->success("添加成功", U('lists'));
} else { } else {
@ -377,6 +380,13 @@ class PromoteController extends ThinkController
} }
} }
addOperationLog(['op_type'=>1,
'key'=>$data['account'].$data['password'].$data['second_pwd'].$data['status'].$data['child_game_permission'].$data['mark1'].$data['mark2'],
'op_name'=>'编辑推广员',
'url'=>U('Promote/edit',['id'=>$_POST['id']]),
'menu'=>'推广员-推广员管理-推广员列表-编辑推广员']);
$this->success("修改成功", U('lists')); $this->success("修改成功", U('lists'));
} else { } else {
$this->error("修改失败"); $this->error("修改失败");
@ -441,9 +451,14 @@ class PromoteController extends ThinkController
$model=$_REQUEST['model']; $model=$_REQUEST['model'];
unset($_REQUEST['model']); unset($_REQUEST['model']);
} }
$a=0; $a=0;
$map['id']=array('in',$_REQUEST['ids']); $map['id']=array('in',$_REQUEST['ids']);
$set=M('promote', 'tab_')->where($map)->setField('status', $_REQUEST['status']); $set=M('promote', 'tab_')->where($map)->setField('status', $_REQUEST['status']);
// echo M()->_sql();die();
if ($set) { if ($set) {
if ($_REQUEST['status']==1) { if ($_REQUEST['status']==1) {
$select=M('promote', 'tab_')->where($map)->select(); $select=M('promote', 'tab_')->where($map)->select();
@ -451,9 +466,18 @@ class PromoteController extends ThinkController
if ($count=="000000") { if ($count=="000000") {
$a++; $a++;
} }
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑审核解锁','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑审核解锁']);
} }
$this->success('操作成功');/**,已通知'.$a.'人'*/ $this->success('操作成功');/**,已通知'.$a.'人'*/
} else { } else {
$select=M('promote', 'tab_')->where($map)->select();
foreach ($select as $key => $value) {
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑审核锁定','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑审核锁定']);
}
$this->success('操作成功'); $this->success('操作成功');
} }
} else { } else {
@ -483,9 +507,20 @@ class PromoteController extends ThinkController
if ($count=="000000") { if ($count=="000000") {
$a++; $a++;
} }
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑资质审核','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑资质审核']);
} }
$this->success('操作成功');/**,已通知'.$a.'人'*/ $this->success('操作成功');/**,已通知'.$a.'人'*/
} else { } else {
$select=M('promote', 'tab_')->where($map)->select();
foreach ($select as $key => $value) {
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑拒绝身份通过','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑拒绝身份通过']);
}
$this->success('操作成功'); $this->success('操作成功');
} }
} else { } else {
@ -1040,6 +1075,13 @@ class PromoteController extends ThinkController
$res = M('config')->where(array('name'=>$config_key))->save($config); $res = M('config')->where(array('name'=>$config_key))->save($config);
S('DB_CONFIG_DATA', null); S('DB_CONFIG_DATA', null);
if ($res !== false) { if ($res !== false) {
if ($val == 0) {
addOperationLog(['op_type'=>1,'key'=>getNowDate(),'op_name'=>'关闭自动审核','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-关闭自动审核']);
} else if ($val == 1) {
addOperationLog(['op_type'=>1,'key'=>getNowDate(),'op_name'=>'开启自动审核','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-开启自动审核']);
}
$this->success('操作成功'); $this->success('操作成功');
} else { } else {
$this->error('操作失败'); $this->error('操作失败');
@ -1050,9 +1092,15 @@ class PromoteController extends ThinkController
{ {
if (IS_AJAX) { if (IS_AJAX) {
M()->startTrans(); M()->startTrans();
$data = M('promote', 'tab_')->where("id={$_POST['id']} ")->find();
$result = M('promote', 'tab_')->where("chain like '%/{$_POST['id']}/%' or id={$_POST['id']} ")->delete(); $result = M('promote', 'tab_')->where("chain like '%/{$_POST['id']}/%' or id={$_POST['id']} ")->delete();
if ($result) { if ($result) {
M()->commit(); M()->commit();
addOperationLog(['op_type'=>2,'key'=>$data['account'],'op_name'=>'删除推广员','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-删除推广员']);
$this->ajaxReturn(array('status'=>1,'msg'=>'删除成功')); $this->ajaxReturn(array('status'=>1,'msg'=>'删除成功'));
} else { } else {
M()->rollback(); M()->rollback();
@ -1301,6 +1349,11 @@ class PromoteController extends ThinkController
} }
$res = M('promote_belong', 'tab_')->add($data); $res = M('promote_belong', 'tab_')->add($data);
if ($res) { if ($res) {
$promote = M('promote','tab_')->where(['id'=>$promote_id])->find();
addOperationLog(['op_type'=>0,'key'=>$promote['account'],'op_name'=>'工会归属申请','url'=>U('Promote/belong'),'menu'=>'推广员-推广员管理-推广公会归属管理-工会归属申请']);
$this->success("申请成功", U('belong')); $this->success("申请成功", U('belong'));
} else { } else {
$this->error('申请失败'); $this->error('申请失败');
@ -1335,6 +1388,11 @@ class PromoteController extends ThinkController
); );
$res = M('promote_belong', 'tab_')->where(['id' => I('id')])->save($data); $res = M('promote_belong', 'tab_')->where(['id' => I('id')])->save($data);
if ($res) { if ($res) {
$promote = M('promote','tab_')->where(['id'=>$promote_id])->find();
addOperationLog(['op_type'=>1,'key'=>$promote['account'],'op_name'=>'编辑工会归属申请','url'=>U('Promote/belong_edit',['id'=>I('id')]),'menu'=>'推广员-推广员管理-推广公会归属管理-编辑工会归属申请']);
$this->success("编辑成功", U('belong')); $this->success("编辑成功", U('belong'));
} else { } else {
$this->error('编辑失败'); $this->error('编辑失败');
@ -1361,6 +1419,8 @@ class PromoteController extends ThinkController
'approver_name' => getAdmin('username'), 'approver_name' => getAdmin('username'),
'verify_time' => time() 'verify_time' => time()
]); ]);
if (!is_null($res) ) { if (!is_null($res) ) {
if ($verify_status == 1) {//审核通过才修改推广员的归属关系 if ($verify_status == 1) {//审核通过才修改推广员的归属关系
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select(); $promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
@ -1374,8 +1434,22 @@ class PromoteController extends ThinkController
$res = M("promote", "tab_") $res = M("promote", "tab_")
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ") ->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ")
->save($update); ->save($update);
$promoteData = M('promote','tab_')->field('account')->where(['id'=>$promote_belong['promote_id']])->find();
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'推广公会归属审核通过','url'=>U('Promote/belong'),'menu'=>'推广员-推广员管理-推广公会归属管理-推广公会归属审核通过']);
}
} else if ($verify_status == 2) {
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
foreach ($promote_belongs as $promote_belong) {
$promoteData = M('promote','tab_')->field('account')->where(['id'=>$promote_belong['promote_id']])->find();
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'推广公会归属审核拒绝','url'=>U('Promote/belong'),'menu'=>'推广员-推广员管理-推广公会归属管理-推广公会归属审核拒绝']);
} }
} }
$this->success("操作成功", U('belong')); $this->success("操作成功", U('belong'));
} else { } else {
$this->error('操作失败'); $this->error('操作失败');
@ -1488,6 +1562,11 @@ class PromoteController extends ThinkController
if ($result === false) { if ($result === false) {
$this->error('操作失败'); $this->error('操作失败');
} else { } else {
$promoteData = M('promote','tab_')->field('account')->where(['id'=>$promoteId])->find();
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'资质认证','url'=>U('Promote/certification',['id'=>$promoteId]),'menu'=>'推广员-推广员管理-推广员列表-资质认证']);
$this->success('操作成功'); $this->success('操作成功');
} }
} else { } else {

@ -88,6 +88,15 @@ class SupportController extends ThinkController {
$res=M('test_resource','tab_')->where($map)->save($data); $res=M('test_resource','tab_')->where($map)->save($data);
if($res!==false){ if($res!==false){
$resourceData = M('test_resource','tab_')
->join('left join tab_user on tab_test_resource.user_id = tab_user.id')
->field('user_account,tab_user.promote_account')
->where(['tab_test_resource.id'=>$map['id']])
->find();
addOperationLog(['op_type'=>1,'key'=>$resourceData['promote_account'].$resourceData['user_account'],'op_name'=>'资源发放审核','url'=>U('Support/lists'),'menu'=>'推广员-推广员管理-推广补链-资源发放审核']);
$this->ajaxReturn(['status'=>1,'msg'=>'操作成功!']); $this->ajaxReturn(['status'=>1,'msg'=>'操作成功!']);
}else{ }else{
$this->ajaxReturn(['status'=>0,'msg'=>'操作失败!']); $this->ajaxReturn(['status'=>0,'msg'=>'操作失败!']);
@ -108,6 +117,15 @@ class SupportController extends ThinkController {
$data['apply_status']=1; $data['apply_status']=1;
$res=M('test_resource','tab_')->where($map)->save($data); $res=M('test_resource','tab_')->where($map)->save($data);
if($res!==false){ if($res!==false){
$resourceData = M('test_resource','tab_')
->join('left join tab_user on tab_test_resource.user_id = tab_user.id')
->field('user_account,tab_user.promote_account')
->where(['tab_test_resource.id'=>$map['id']])
->find();
addOperationLog(['op_type'=>1,'key'=>$resourceData['promote_account'].$resourceData['user_account'],'op_name'=>'资源发放拒绝','url'=>U('Support/lists'),'menu'=>'推广员-推广员管理-推广补链-资源发放拒绝']);
$this->ajaxReturn(['status'=>1,'msg'=>'操作成功!']); $this->ajaxReturn(['status'=>1,'msg'=>'操作成功!']);
}else{ }else{
$this->ajaxReturn(['status'=>0,'msg'=>'操作失败!']); $this->ajaxReturn(['status'=>0,'msg'=>'操作失败!']);

Loading…
Cancel
Save