新增打款删除

master
chenzhi 3 years ago
parent 19f0fb268a
commit f3aebbe127

@ -102,6 +102,20 @@ class WxPaymentController extends BaseController
$this->ajaxReturn(["status"=>1,"msg"=>"添加成功"]); $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() public function customerExport()
{ {
$where["_string"]="1=1"; $where["_string"]="1=1";

@ -164,6 +164,7 @@
<div class="butnbox" > <div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px"> <div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class='butn' id='customerExport'>导出所选记录</a> <a class='butn' id='customerExport'>导出所选记录</a>
<a class='butn' style="background-color: red;" id='batchDel'>批量删除</a>
</div> </div>
</div> </div>
@ -380,6 +381,47 @@
$("body").append(iframeExcel); $("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("<font style='color:white'>" + '请先选择要删除的数据' + "</font>");
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("<font style='color:white'>" + data.msg + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.msg + "</font>");
return false;
}
}
});
}
});
$("#search").click(function(){ $("#search").click(function(){
var url = $(this).attr('url'); var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize(); var query = $('.jssearch').find('input').serialize();

Loading…
Cancel
Save