From f3aebbe127165fa9a7635ad9689516cbed0135ee Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 8 Oct 2021 15:10:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=93=E6=AC=BE=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/WxPaymentController.class.php | 14 +++++++ .../Payment/View/WxPayment/customerLists.html | 42 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/Application/Payment/Controller/WxPaymentController.class.php b/Application/Payment/Controller/WxPaymentController.class.php index 523c14bf3..d39744aff 100644 --- a/Application/Payment/Controller/WxPaymentController.class.php +++ b/Application/Payment/Controller/WxPaymentController.class.php @@ -102,6 +102,20 @@ class WxPaymentController extends BaseController $this->ajaxReturn(["status"=>1,"msg"=>"添加成功"]); } + public function batchDel() + { + if(!$_REQUEST['ids']) $this->ajaxReturn(["status"=>0,"msg"=>"请先选择要删除的数据"]); + $where = [ + "id"=>["in",$_REQUEST['ids']] + ]; + $res = M('mini_program_user', 'tab_') + ->where($where) + ->delete(); + if(!$res) $this->ajaxReturn(["status"=>0,"msg"=>"删除失败,请联系管理员"]); + + $this->ajaxReturn(["status"=>1,"msg"=>"删除成功"]); + } + public function customerExport() { $where["_string"]="1=1"; diff --git a/Application/Payment/View/WxPayment/customerLists.html b/Application/Payment/View/WxPayment/customerLists.html index 3ae4c8701..a80d72fc3 100644 --- a/Application/Payment/View/WxPayment/customerLists.html +++ b/Application/Payment/View/WxPayment/customerLists.html @@ -164,6 +164,7 @@
@@ -380,6 +381,47 @@ $("body").append(iframeExcel); } }); + + $("#batchDel").click(function () { + var flag = false; + var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { + return $(elem).data("verify_id"); + }).get(); + + if(text.length < 1){ + layer.msg("" + '请先选择要删除的数据' + ""); + return; + } + layer.confirm('【警告】删除后将不可回退,请慎重选择', { + btn: ['确认','取消'], + title:false + }, function(index){ + layer.close(index); + _del(); + }); + function _del(){ + var id = text.join(","); + $.ajax({ + type: "POST", + url: "{:U('batchDel')}", + dataType: 'json', + async: true, + data: {ids:id}, + success:function(data){ + if(data.status==1){ + layer.msg("" + data.msg + ""); + setTimeout(function(){ + window.location.reload(); + },1500); + }else{ + layer.msg("" + data.msg + ""); + return false; + } + } + }); + } + }); + $("#search").click(function(){ var url = $(this).attr('url'); var query = $('.jssearch').find('input').serialize();