/// <summary> /// 删除会员 /// </summary> public void User_Del() { if (!EX_Admin.Power("user_del", "删除会员")) { AjaxNoPower(); return; } string id = RequestTool.RequestString("ids"); if (id == "") { Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}"); return; } if (RequestTool.GetConfigKey("IsDelFalse").ToLower() == "true") { List <Lebi_User> users = B_Lebi_User.GetList("id in (lbsql{" + id + "})", ""); foreach (var u in users) { u.IsDel = 1; B_Lebi_User.Update(u); } } else { List <Lebi_Order> modellist = B_Lebi_Order.GetList("User_id in (lbsql{" + id + "})", ""); foreach (Lebi_Order model in modellist) { B_Lebi_Order.Delete("id = " + model.id + ""); B_Lebi_Order_Log.Delete("Order_id = " + model.id + ""); B_Lebi_Order_Product.Delete("Order_id = " + model.id + ""); } B_Lebi_User.Delete("id in (lbsql{" + id + "})"); B_Lebi_Message.Delete("User_id_To in (lbsql{" + id + "})"); B_Lebi_User_Answer.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_Answer.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_BuyMoney.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_Card.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_Money.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_Point.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_Product.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_User_Address.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Supplier.Delete("User_id in (lbsql{" + id + "})"); //B_Lebi_Supplier_ProductType.Delete("Supplier_id in (lbsql{" + id + "})"); //B_Lebi_Supplier_Verified_Log.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Agent_Area.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Agent_Money.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Agent_Product.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Agent_Product_request.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Agent_Product_User.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Bill.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Cash.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_Comment.Delete("User_id in (lbsql{" + id + "})"); B_Lebi_weixin_qrcode.Delete("User_id in (lbsql{" + id + "})"); } Log.Add("删除会员", "User", id.ToString(), CurrentAdmin, id.ToString()); Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 删除安全问题 /// </summary> public void Question_Del() { if (!EX_Admin.Power("user_edit", "编辑会员")) { AjaxNoPower(); } int id = RequestTool.RequestInt("id", 0); B_Lebi_User_Answer.Delete("User_id = " + id + ""); Log.Add("删除安全问题", "User_Answer", id.ToString(), CurrentAdmin, id.ToString()); Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 编辑安全问题 /// </summary> public void Question_Edit() { int type = RequestTool.RequestInt("type", 0); int Question_id1 = RequestTool.RequestInt("Question_id1", 0); int Question_id2 = RequestTool.RequestInt("Question_id2", 0); string Answer1 = EX_User.MD5(RequestTool.RequestSafeString("Answer1")); string Answer2 = EX_User.MD5(RequestTool.RequestSafeString("Answer2")); if (Question_id1 == Question_id2) { Response.Write("{\"msg\":\"" + Tag("请选择两个不同的问题") + "\"}"); return; } if (Answer1 == "" || Answer2 == "") { Response.Write("{\"msg\":\"" + Tag("请填写问题答案") + "\"}"); return; } bool addflag = false; Lebi_User_Answer model = B_Lebi_User_Answer.GetModel("User_id = " + CurrentUser.id + ""); if (model == null) { addflag = true; model = new Lebi_User_Answer(); } if (addflag) { model.User_Question_id = Question_id1; model.Answer = Answer1; model.User_id = CurrentUser.id; B_Lebi_User_Answer.Add(model); model.User_Question_id = Question_id2; model.Answer = Answer2; model.User_id = CurrentUser.id; B_Lebi_User_Answer.Add(model); } else { int i = 0; List <Lebi_User_Answer> modellists = B_Lebi_User_Answer.GetList("User_id = " + CurrentUser.id + "", "id asc"); foreach (Lebi_User_Answer modellist in modellists) { if (i == 0 && modellist.Answer != Answer1) { Response.Write("{\"msg\":\"" + Tag("问题答案回答不正确") + "\"}"); return; } if (i == 1 && modellist.Answer != Answer2) { Response.Write("{\"msg\":\"" + Tag("问题答案回答不正确") + "\"}"); return; } i++; } if (type == 1) { CurrentUser.Pay_Password = ""; B_Lebi_User.Update(CurrentUser); Response.Write("{\"msg\":\"OK\",\"type\":\"1\",\"url\":\"" + URL("P_UserChangePassword", "") + "\"}"); return; } else { B_Lebi_User_Answer.Delete("User_id = " + CurrentUser.id + ""); } } Response.Write("{\"msg\":\"OK\",\"type\":\"0\"}"); }