Commit 01bac00f authored by zhoujun's avatar zhoujun

清除工具

parent c105c75c
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
/public/*.htaccess /public/*.htaccess
/storage/*.key /storage/*.key
/storage/logs/* /storage/logs/*
/public/card
/public/cardImg
/vendor /vendor
.env .env
.env.backup .env.backup
......
...@@ -159,4 +159,30 @@ class AdminController extends Controller ...@@ -159,4 +159,30 @@ class AdminController extends Controller
return $this->getErrorMsg('10063', '审核失败'); return $this->getErrorMsg('10063', '审核失败');
} }
/**
* 删除角色信息
* @date 2021/06/10
* @author live
*/
public function getDeleteRole(Request $request)
{
$postData = $request->all();
$serverId = $postData['serverId'] ?? '';
$roleId = $postData['roleId'] ?? '';
$tableName = 'wx_card_role_'.$serverId;
if($serverId == '' || $roleId == '') return $this->getErrorMsg('10060', '参数错误');
$verity = DB::connection('wx_mysql')->table($tableName)->where('role_id',$roleId)->first();
if(!$verity) return $this->getErrorMsg('10061', '区服角色不匹配');
$uid = $verity->uid;
$result = DB::connection('wx_mysql')->table($tableName)->where('role_id',$roleId)->delete();
if($result){
$row = WxUserImg::where('uid',$uid)->where('server_id',$serverId)->where('role',$roleId)->first();
$row->delete();
return $this->getSuccessMsg([]);
}
return $this->getErrorMsg('10062', '清除角色失败');
}
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<div class="panel col-lg-12"> <div class="panel col-lg-12">
<div class="panel-content"> <div class="panel-content">
<div class="text-md mt-md bg-scale-0 mb-sm" style="height: 30px;"><a href="">图片审核</a> <div class="text-md mt-md bg-scale-0 mb-sm" style="height: 30px;"><a href="">图片审核</a>
<button class="add-item btn btn-o btn-primary btn-xs pull-right" onclick="return deleteRole();" style="height: 30px;">清除角色信息<i class="fa fa-plus coloff"></i></button>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<form action="" method="GET" onsubmit="return check();"> <form action="" method="GET" onsubmit="return check();">
...@@ -108,6 +109,39 @@ ...@@ -108,6 +109,39 @@
@include('admin.common.foot') @include('admin.common.foot')
<script> <script>
function deleteRole(){
$('#DELETE_ROLE').modal('show')
}
function delRoleSave(){
var serverId = $('#del_server_id').val();
var token = $("input[name='_token']").val();
var roleId = $('#del_role_id').val();
$('#del_cir_role').attr("disabled",true);
$('#del_cir_role_shut').attr("disabled",true);
$.ajax({
type: 'POST',
url: '/admin/delete/role',
data: {_token:token,serverId:serverId,roleId:roleId},
success:function(data){
$('#show_error_info').html(data.info);
$('#show_success_info').html(data.info);
$('#del_cir_role').attr("disabled",false);
$('#del_cir_role_shut').attr("disabled",false);
$('#DELETE_ROLE').modal('hide')
if(data.code == 200){
$('#message-success-modal').modal('show')
}else{
verity_field(data.info,'show_error_info');
$("#message-error-modal").modal('show');
}
}
});
}
function setAllStatus(){ function setAllStatus(){
$('#ALL_VERITY').modal('show') $('#ALL_VERITY').modal('show')
} }
......
...@@ -106,4 +106,31 @@ ...@@ -106,4 +106,31 @@
</div> </div>
</div> </div>
<div class="modal fade" id="DELETE_ROLE" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">删除角色信息</h4>
</div>
<div class="modal-body">
<div class="panel-content">
<div class="row">
<div class="form-group col-lg-6">
<h6>区服ID</h6>
<input type="text" class="form-control" id="del_server_id" placeholder="区服ID">
</div>
<div class="form-group col-lg-6">
<h6>角色ID</h6>
<input type="text" class="form-control" id="del_role_id" placeholder="角色ID">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary active" id="del_cir_role" onclick="return delRoleSave();">提交</button>
<button type="button" class="btn btn-default active" id="del_cir_role_shut" onclick="return cir_cancel('DELETE_ROLE');">取消</button>
</div>
</div>
</div>
</div>
...@@ -35,6 +35,7 @@ Route::prefix('admin')->namespace('Admin')->middleware('check.adminLogin')->grou ...@@ -35,6 +35,7 @@ Route::prefix('admin')->namespace('Admin')->middleware('check.adminLogin')->grou
Route::get('/image/list', 'AdminController@getImgList')->name('checkImg'); Route::get('/image/list', 'AdminController@getImgList')->name('checkImg');
Route::post('/save/status', 'AdminController@getSaveStatus'); Route::post('/save/status', 'AdminController@getSaveStatus');
Route::post('/save/status/all', 'AdminController@getSaveStatusAll'); Route::post('/save/status/all', 'AdminController@getSaveStatusAll');
Route::post('/delete/role', 'AdminController@getDeleteRole');
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment