产品数据库提供真实删除功能

This commit is contained in:
wule committed 2026-09-05 13:37:32 +08:00
1 parent 0039ca5bf6
commit 0f072ebd07
3 files changed
+19 -8

No files matched your search

+17 -7
View File
@@ -671,6 +671,7 @@ namespace KJD_Web.BLL.BXX
var fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'");
var sale_count_num_less = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_num_less"))?.Replace("'", "\\'");
var sale_count_num_more = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_num_more"))?.Replace("'", "\\'");
var is_del = RegexUtils.GetStringQuery(ref inputData, "is_del").ParseToInt();
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
@@ -720,7 +721,7 @@ namespace KJD_Web.BLL.BXX
//sql += " LEFT JOIN bxx.jst_supplier_ban_platform b ON (p.skc_id=b.coid or p.real_coid=b.coid)" +
if (forceIndex.Count > 0)
sql += " FORCE INDEX(" + string.Join(",", forceIndex) + ")";
sql += " WHERE p.is_del=0";
sql += " WHERE p.is_del=" + is_del;
string where = "";
if (!string.IsNullOrEmpty(from_shop_id))
@@ -923,7 +924,7 @@ namespace KJD_Web.BLL.BXX
" FROM " + tableName + " p";
if (forceIndex.Count > 0)
sql += " FORCE INDEX(" + string.Join(",", forceIndex) + ")";
sql += " WHERE p.is_del=0";
sql += " WHERE p.is_del=" + is_del;
//where子句
sql += where;
@@ -951,14 +952,14 @@ namespace KJD_Web.BLL.BXX
if (isDetail)
sql = " SELECT p.*" +
" from " + tableName + " p" +
" where p.is_del=0";
" where p.is_del=" + is_del;
else
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name," +
" p.main_img,p.notes,p.add_time,p.mdy_time,p.fission_words,p.head_words,p.end_words,p.group," +
" p.product_get_type,p.wx_safe_status,p.sale_count_num,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation,p.view_uv,p.add_user_name" +
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation,p.view_uv,p.add_user_name,p.is_del" +
" FROM " + tableName + " p" +
" WHERE p.is_del=0";
" WHERE p.is_del=" + is_del;
sql += " and id in (" + db_ids + ")";
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
@@ -1017,7 +1018,7 @@ namespace KJD_Web.BLL.BXX
real_spu_id = row["real_spu_id"].IsNullOrEmpty() ? null : row["real_spu_id"].ParseToString(),
is_relation = row["is_relation"].ParseToInt(),
add_user_name = row["add_user_name"].ParseToString(),
is_del = row["is_del"].ParseToNullableInt(),
};
if (isDetail)
{
@@ -2473,6 +2474,7 @@ namespace KJD_Web.BLL.BXX
{
return "{\"code\":500,\"msg\":\"删除失败:请指定要删除的数据!\"}";
}
var is_real_del = RegexUtils.GetStringQuery(ref inputData, "is_real_del")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
@@ -2480,8 +2482,16 @@ namespace KJD_Web.BLL.BXX
string tableName = GetProductTableName(inputData);
string sql = "";
if (tableName != "bxx.product")
sql = "SELECT sa_level FROM wxxd.user WHERE user_name='" + user_name + "'";
var sa_level = mySql.ExecuteFirstInt(sql);
var is_normal_user = false;
if (mySql.Message.IsNullOrEmpty() && sa_level == 0)
is_normal_user = true;
if (tableName != "bxx.product" || is_normal_user)
sql = "delete from " + tableName + " where id='" + id + "'";
else if (is_real_del.ToLower() == "true")
sql = "delete from " + tableName + " where id='" + id + "' and is_del=1";
else
sql = "update " + tableName + " set is_del=1 where id='" + id + "'";
+1 -1
View File
@@ -2359,7 +2359,7 @@ namespace KJD_Web.BLL.WXXD
public string GetWxTaskStatus(string inputData, bool isDetail = false)
{
// 暂时先拿掉
//return "{\"code\":19999,\"msg\":\"参数为空\"}";
return "{\"code\":19999,\"msg\":\"参数为空\"}";
if (string.IsNullOrEmpty(inputData))
return "{\"code\":19999,\"msg\":\"参数为空\"}";
@@ -107,6 +107,7 @@ namespace KJD_Web.Model
public string problem_prod_data { get; set; }
public int is_relation { get; set; }
public string add_user_name { get; set; }
public int? is_del { get; set; }
}
public class KJDDBProduct : DBProductResultParam