产品数据库标题可修改,货号加价删除提供进度条

This commit is contained in:
wule committed 2025-08-15 19:20:01 +08:00
1 parent 157f7e9f3e
commit 14ac8986c8
11 files changed
+68 -31

No files matched your search

@@ -277,6 +277,7 @@ namespace KJD_Web.BLL
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
var product_name = RegexUtils.GetStringQuery(ref inputData, "product_name")?.Replace("'", "\\'");
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'");
string fission_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_words"))?.Replace("'", "\\'");
@@ -291,6 +292,8 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "update kjd.product set";
if (product_name != null)
sql += " product_name='" + product_name + "',";
if (notes != null)
sql += " notes='" + notes + "',";
if (ext_code != null)
@@ -362,7 +365,9 @@ namespace KJD_Web.BLL
sql += "\r\n";
sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
sql += "update kjd.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";";
//sql += "update kjd.shop_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
//sql += "update kjd.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
//sql += "INSERT INTO kjd.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" +
// "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)";
}
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
@@ -316,7 +316,9 @@ namespace KJD_Web.BLL
add_product_remaining = add_product_remaining - 1;
sql += "\r\n";
sql += "update kjd.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
//sql += "update kjd.shop_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
//sql += "update kjd.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
//sql += "INSERT INTO kjd.shop_add_prod_count(shop_id, add_product_remaining) VALUES('" + shop_id + "'," + add_product_remaining + ")" +
// "ON DUPLICATE KEY UPDATE add_product_remaining=VALUES(add_product_remaining)";
}
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();
+32 -17
View File
@@ -43,28 +43,28 @@ namespace KJD_Web.BLL
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
string sql = "select count(id) from kjd.shop where 1=1";
string sql = "SELECT COUNT(s.id) FROM kjd.shop s WHERE 1=1";
//where子句
string where = "";
if (isAdmin)
where += " and (cookie='' or shop_id!='')";
where += " and (s.cookie='' or s.shop_id!='')";
if (!isAdmin)
where += " and (user_name='" + user_name + "' or sub_user_name like '%" + user_name + "%')";
where += " and (s.user_name='" + user_name + "' or s.sub_user_name like '%" + user_name + "%')";
if (!string.IsNullOrWhiteSpace(operate_sub_sa_name))
where += " and operate_sub_sa_name='" + operate_sub_sa_name + "'";
where += " and s.operate_sub_sa_name='" + operate_sub_sa_name + "'";
if (!string.IsNullOrWhiteSpace(search_user_name))
where += " and user_name like '%" + search_user_name + "%'";
where += " and s.user_name like '%" + search_user_name + "%'";
if (!string.IsNullOrWhiteSpace(search_login_name))
where += " and login_name like '%" + search_login_name + "%'";
where += " and s.login_name like '%" + search_login_name + "%'";
if (!string.IsNullOrWhiteSpace(search_notes))
where += " and notes like '%" + search_notes + "%'";
where += " and s.notes like '%" + search_notes + "%'";
if (!string.IsNullOrWhiteSpace(search_id))
where += " and shop_id like '%" + search_id + "%'";
where += " and s.shop_id like '%" + search_id + "%'";
if (!string.IsNullOrWhiteSpace(search_name))
where += " and shop_account like '%" + search_name + "%'";
where += " and s.shop_account like '%" + search_name + "%'";
if (!string.IsNullOrWhiteSpace(shop_ids))
where += " and shop_id in (" + shop_ids + ")";
where += " and s.shop_id in (" + shop_ids + ")";
sql += where;
var count = mySql.ExecuteRowCount(sql);
@@ -76,14 +76,17 @@ namespace KJD_Web.BLL
}
else
{
sql = "select id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name,company_name,notes,login_status," +
" login_status2,add_product_remaining,add_product_month,add_time,mdy_time,add_sub_sa_time,operate_sub_sa_name" +
" from kjd.shop where 1=1";
// LEFT JOIN kjd.product_select s ON p.id=s.out_product_id
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," +
"s.company_name,s.notes,s.login_status,s.login_status2,s.add_product_remaining,s.add_product_month,s.add_time,s.mdy_time," +
"s.add_sub_sa_time,s.operate_sub_sa_name";
sql += " FROM kjd.shop s WHERE 1=1";
//sql += " FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
sql += where; // where 子句
sql += " order by id desc";
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
sql += " ORDER BY s.id DESC";
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
dt = mySql.ExecuteDataTable(sql);
}
@@ -123,8 +126,20 @@ namespace KJD_Web.BLL
var shopMonthIdList = shopMonthList.Select(s => s.id);
mySql = new MysqlUtils(conn);
string ids = string.Join(",", shopMonthIdList);
sql = "update kjd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month +
" where 1=1 and id in (" + ids + ")";
sql = "";
sql += "update kjd.shop set add_product_remaining=" + remainCount + ", add_product_month=" + month +
" where 1=1 and id in (" + ids + ");";
//sql += "\r\nINSERT INTO kjd.shop_add_prod_count(shop_id,shop_account,add_product_remaining,add_product_month) VALUES ";
//foreach (var shop in shopList)
//{
//sql+= "\r\n('" + shop.shop_id + "','" + shop.shop_account + "'," + remainCount + "," + month + "),";
//}
//sql = sql.TrimEnd(',') + " \r\n";
//sql += "ON DUPLICATE KEY UPDATE " +
//"shop_account=VALUES(shop_account)," +
//"add_product_remaining=VALUES(add_product_remaining)," +
//"add_product_month=VALUES(add_product_month);";
var rst = mySql.ExecuteNonQuery(sql);
mySql.Close();