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();