请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

请问下老师 删除的 sql语句在哪呢

请问下老师  我没弄明白这个删除的sql语句在哪里,

正在回答

2回答

这删除是逻辑删除,正常的互联网开发中都不会直接删除数据的,因为怕误操作,所以都是逻辑删除。也就是通过某个字段标注已删除等等

1 回复 有任何疑惑可以回复我~
  • 提问者 老帅哥123 #1
    非常感谢!
    回复 有任何疑惑可以回复我~ 2018-10-06 12:46:24
  • 请问老师有物理删除的代码逻辑吗
    回复 有任何疑惑可以回复我~ 2020-07-12 16:32:59
  • delete from table_name where id = x
    回复 有任何疑惑可以回复我~ 2020-07-13 09:03:07
johnny1981 2020-07-18 23:14:27
;
var account_index_ops = {
    init: function () {
        this.eventBind();
    },
    eventBind: function () {
        var that = this;
        $("#remove").click(function () {
            that.ops("#remove", $(this).attr("data"));
            if (!confirm("是否确认删除?")) {
                return false
            }
            window.location.reload()
        });
    },
    ops:function (act, id){
        $.ajax({
            url: common_ops.buildUrl("/account/ops"),
            type: 'POST',
            data: {
                act: act,
                id: id
            },
            dataType: 'json',
            success: function (res) {
                btn_target.removeClass("disabled");
                alert(res.msg);
                if (res.code == 200) {
                    window.location.href = window.location.href;
                }
            }
        });
    }
};

老师我是通过ajax请求来删除列表页中的数据

问题:我用的是系统的对话框来删除的,代码如下

 if (!confirm("是否确认删除?")) {
      return false
}


实际上我想用自己做好的模态框来请求服务端删除数据

var account_index_ops = {
   init: function () {
       this.eventBind();
   },
   eventBind: function () {
       $("#save").click(function () {
           var btn_target = $(this);
           if (btn_target.hasClass("disabled")) {
               alert("正在处理!!!请不要重复点击");
               return;
           }

           btn_target.addClass("disabled");
       });

       var data = {
           id:id,
       };

       $.ajax({
           url: common_ops.buildUrl("/account/ops"),
           type: 'POST',
           data: data,
           dataType: 'json',
           success: function (res) {
               btn_target.removeClass("disabled");
               alert(res.msg);
               if (res.code == 200) {
                   window.location.href = common_ops.buildUrl("/account/index");
               }
           }
       });
   },
};

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信