From 8aad24dc1f0b154118c557edd6dd495b073768ae Mon Sep 17 00:00:00 2001 From: fengjh5 Date: Tue, 16 Apr 2024 16:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=B8=AA=E7=94=A8=E6=88=B7=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backstage/controllers/User.php | 9 ++++++++ .../backstage/views/user/user_batch_tool.php | 2 +- .../backstage/views/user/user_index.php | 23 +++++++++++++++++++ .../backstage/views/user/user_list.php | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) 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(); +