diff --git a/Application/Admin/Controller/TestWhiteListController.class.php b/Application/Admin/Controller/TestWhiteListController.class.php index 0b7f0e280..98566be9a 100644 --- a/Application/Admin/Controller/TestWhiteListController.class.php +++ b/Application/Admin/Controller/TestWhiteListController.class.php @@ -200,4 +200,32 @@ class TestWhiteListController extends ThinkController } } + public function deleteWhileUser() { + + $userId = $_REQUEST['id']; + +// dump($userId);die(); + + $userWhite = M('test_white_list','tab_')->where(['id'=>$userId])->find(); + + + if ($userWhite) { + + $del = M('test_white_list','tab_')->where(['id'=>$userId])->delete(); + + if ($del) { + $this->ajaxReturn(['status'=>0,'msg'=>"删除成功"]); + } else { + $this->ajaxReturn(['status'=>0,'msg'=>"删除失败"]); + } + + } else { + + $this->ajaxReturn(['status'=>0,'msg'=>"账号不存在,删除失败"]); + + } + + + } + } diff --git a/Application/Admin/View/TestWhiteList/lists.html b/Application/Admin/View/TestWhiteList/lists.html index 2d24fc52a..bd767247c 100644 --- a/Application/Admin/View/TestWhiteList/lists.html +++ b/Application/Admin/View/TestWhiteList/lists.html @@ -81,7 +81,11 @@ {$data.add_user} {$data.create_ime} - 编辑 + + + + 删除 + 锁定 @@ -151,6 +155,25 @@ } }) + $('.del_user').on({ + click: function() { + var url = $(this).attr('href-hhh'); + console.log(url); + layer.confirm('是否确认删除测试账号?', {icon: 3, title:'提示',skin:'textColor'}, function(index){ + $.ajax({ + url: url, + type: 'post', + dataType: 'json', + success: function(response) { + layer.msg(response.msg, {time: 1000,skin:'msgClolor'}, function() { + window.location.href = window.location.href + }) + } + }) + }) + } + }) + //搜索功能 $("#search").click(function () { var url = $(this).attr('url');