diff --git a/backstage/application/backstage/controllers/User.php b/backstage/application/backstage/controllers/User.php index 68f7df4..acc0a92 100644 --- a/backstage/application/backstage/controllers/User.php +++ b/backstage/application/backstage/controllers/User.php @@ -201,6 +201,15 @@ class User extends CI_Controller echo json_encode($data); } + //单个停用用户 + public function deleteUser() + { + $userId = $this->input->post('userId'); + $this->tb_user->update(array('enabled' => -99), array('id' => $userId)); + $data = array('success' => true, 'msg' => '已经删除用户'); + echo json_encode($data); + } + public function userExcel() { $this->load->model('dininghall_model'); diff --git a/backstage/application/backstage/views/user/user_batch_tool.php b/backstage/application/backstage/views/user/user_batch_tool.php index 1056b4e..de6875d 100644 --- a/backstage/application/backstage/views/user/user_batch_tool.php +++ b/backstage/application/backstage/views/user/user_batch_tool.php @@ -97,7 +97,7 @@
-

批量停用用户 " class="btn btn-info btn-xs"> 模版下载

+

批量删除用户 " class="btn btn-info btn-xs"> 模版下载

diff --git a/backstage/application/backstage/views/user/user_index.php b/backstage/application/backstage/views/user/user_index.php index bbae7e2..329e136 100644 --- a/backstage/application/backstage/views/user/user_index.php +++ b/backstage/application/backstage/views/user/user_index.php @@ -454,5 +454,28 @@ $userTypeList = isset($userTypeList) ? $userTypeList : array(); }) } + // 用户删除 + function deleteUser(userId,username) { + var userConfirmation = window.confirm(username+"用户删除后将不可恢复,请确认!"); + + if (userConfirmation) { + // 用户点击了确定 + $.post("", { + 'userId': userId + }, function(data) { + var data = JSON.parse(data); + if (typeof(data.success) != "undefined") { + $.zui.messager.show(data.msg); + if (data.success) getListByPage(currPage); + } + }); + + } else { + // 用户点击了取消 + $.zui.messager.show("取消了删除操作。"); + } + + } + diff --git a/backstage/application/backstage/views/user/user_list.php b/backstage/application/backstage/views/user/user_list.php index 73862a4..c7428b0 100644 --- a/backstage/application/backstage/views/user/user_list.php +++ b/backstage/application/backstage/views/user/user_list.php @@ -51,6 +51,7 @@ $userList = isset($userList) ? $userList : array(); +