用户备注功能
This commit is contained in:
1 parent
54ee83df62
commit
c3dc9979d1
21 files changed
+1168
-307
No files matched your search
@@ -465,6 +465,7 @@ namespace KJD_Web.BLL
|
||||
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
|
||||
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
|
||||
var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'");
|
||||
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
|
||||
var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
|
||||
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
|
||||
@@ -504,6 +505,8 @@ namespace KJD_Web.BLL
|
||||
where += " and s.shop_account like '%" + search_shop_account + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and s.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_user_notes))
|
||||
where += " and s.user_notes like '%" + search_user_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
where += " and p.spu_id like '%" + search_spu + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
@@ -535,7 +538,7 @@ namespace KJD_Web.BLL
|
||||
//sql = "select * from kjd.product_select where 1=1";
|
||||
//else
|
||||
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
|
||||
"s.sub_user_name,s.notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
|
||||
"s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
|
||||
"s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," +
|
||||
"p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," +
|
||||
"u.nick_name as operate_sub_sa_nick " +
|
||||
@@ -582,11 +585,12 @@ namespace KJD_Web.BLL
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
|
||||
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
|
||||
fission_product_name = row["fission_product_name"].ToString(),
|
||||
user_notes = row["user_notes"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
};
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
};
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
@@ -705,10 +709,11 @@ namespace KJD_Web.BLL
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
|
||||
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"))?.Replace("'", "\\'");
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
|
||||
string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes"));
|
||||
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"));
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
@@ -719,13 +724,21 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update kjd.product_select set";
|
||||
if (notes != null)
|
||||
sql += " notes='" + notes + "',";
|
||||
sql += " notes=@notes,";
|
||||
if (user_notes != null)
|
||||
sql += " user_notes=@user_notes,";
|
||||
if (fission_product_name != null)
|
||||
sql += " fission_product_name='" + fission_product_name + "',";
|
||||
sql += " fission_product_name=@fission_product_name,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=" + id + ";";
|
||||
sql += " where id=@id;";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
@@ -739,4 +752,22 @@ namespace KJD_Web.BLL
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_id", Value = spu_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "skc_id", Value = skc_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_id", Value = cat_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_name", Value = cat_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_name", Value = product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ext_code", Value = ext_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "main_img", Value = main_img, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "notes", Value = notes.ParseToString(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_md5", Value = product_md5, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "add_time", Value = add_time, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "mdy_time", Value = mdy_time, });
|
||||
rst = mySql.ExecuteInsertId(sql, paramLst.ToArray());*/
|
||||
@@ -28,13 +28,13 @@ namespace KJD_Web.BLL
|
||||
string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id");
|
||||
string skc_id = RegexUtils.GetStringQuery(ref inputData, "skc_id");
|
||||
string cat_id = RegexUtils.GetStringQuery(ref inputData, "cat_id");
|
||||
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"))?.Replace("'", "\\'");
|
||||
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"))?.Replace("'", "\\'");
|
||||
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.Replace("'", "\\'");
|
||||
string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"))?.Replace("'", "\\'");
|
||||
string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"))?.Replace("'", "\\'");
|
||||
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
|
||||
string cat_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "cat_name"));
|
||||
string ext_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "ext_code"));
|
||||
string product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"));
|
||||
string product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"));
|
||||
string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"));
|
||||
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"));
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
@@ -45,18 +45,17 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
var json_sign = RegexUtils.GetStringJson(ref product_json, "signedImageUrl"); // 取商品json数据里不同签名的部分
|
||||
var product_md5 = EncrypUtil.GetMd5(product_json.Replace(json_sign, "") + size_json);
|
||||
sql = "select id from kjd.third_product where product_md5='" + product_md5 + "'";
|
||||
var product_md5 = EncrypUtil.GetMd5(product_json?.Replace(json_sign, "") + size_json);
|
||||
var product_md5_2 = EncrypUtil.GetMd5(product_json?.Replace("'", "\\'").Replace(json_sign, "") + size_json);
|
||||
sql = "select id from kjd.third_product where product_md5='" + product_md5 + "' or product_md5='" + product_md5_2 + "';";
|
||||
var rst = mySql.ExecuteFirstInt(sql).ParseToLong();
|
||||
if (rst <= 0)
|
||||
{
|
||||
//product_json = product_json.Replace("*", "*").Replace("|", "|");
|
||||
//ext_code = product_json.Replace("*", "*").Replace("|", "|");
|
||||
sql = "insert into kjd.third_product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " +
|
||||
"values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" +
|
||||
ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + product_md5 + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
//sql = "insert into kjd.third_product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,product_md5,add_time,mdy_time) " +
|
||||
// "values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" +
|
||||
// ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" + product_md5 + "','" +
|
||||
// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
//rst = mySql.ExecuteInsertId(sql);
|
||||
|
||||
sql = "insert into kjd.third_product (spu_id,skc_id,cat_id,cat_name,product_name," +
|
||||
@@ -67,19 +66,19 @@ namespace KJD_Web.BLL
|
||||
string add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
string mdy_time = add_time;
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_id", Value = spu_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "skc_id", Value = skc_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_id", Value = cat_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "cat_name", Value = cat_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_name", Value = product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "ext_code", Value = ext_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "main_img", Value = main_img, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = product_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "size_json", Value = size_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "notes", Value = notes.ParseToString(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_md5", Value = product_md5, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "add_time", Value = add_time, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "mdy_time", Value = mdy_time, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@spu_id", Value = spu_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@skc_id", Value = skc_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_id", Value = cat_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@cat_name", Value = cat_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_name", Value = product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@ext_code", Value = ext_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@main_img", Value = main_img, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_json", Value = product_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@size_json", Value = size_json, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes.ParseToString(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@product_md5", Value = product_md5, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@add_time", Value = add_time, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@mdy_time", Value = mdy_time, });
|
||||
rst = mySql.ExecuteInsertId(sql, paramLst.ToArray());
|
||||
mySql.Close();
|
||||
}
|
||||
@@ -121,20 +120,24 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(id) from kjd.third_product where 1=1";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
sql += " and spu_id like '%" + search_spu + "%'";
|
||||
where += " and spu_id like '%" + search_spu + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
sql += " and skc_id like '%" + search_skc + "%'";
|
||||
where += " and skc_id like '%" + search_skc + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_cat))
|
||||
sql += " and cat_name like '%" + search_cat + "%'";
|
||||
where += " and cat_name like '%" + search_cat + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_ext_code))
|
||||
sql += " and ext_code like '%" + search_ext_code + "%'";
|
||||
where += " and ext_code like '%" + search_ext_code + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
sql += " and product_name like '%" + search_prod_name + "%'";
|
||||
where += " and product_name like '%" + search_prod_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
sql += " and notes like '%" + search_notes + "%'";
|
||||
where += " and notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
sql += " and id in (" + search_db_ids + ")";
|
||||
where += " and id in (" + search_db_ids + ")";
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
@@ -149,20 +152,8 @@ namespace KJD_Web.BLL
|
||||
else
|
||||
sql = "select id,spu_id,skc_id,cat_id,cat_name,ext_code,product_name,main_img,notes,add_time,mdy_time from kjd.third_product where 1=1";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
sql += " and spu_id like '%" + search_spu + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
sql += " and skc_id like '%" + search_skc + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_cat))
|
||||
sql += " and cat_name like '%" + search_cat + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_ext_code))
|
||||
sql += " and ext_code like '%" + search_ext_code + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
sql += " and product_name like '%" + search_prod_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
sql += " and notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
sql += " and id in (" + search_db_ids + ")";
|
||||
sql += where;
|
||||
|
||||
sql += " order by id desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
@@ -421,13 +412,14 @@ namespace KJD_Web.BLL
|
||||
|
||||
var shop_ids = RegexUtils.GetStringQuery(ref inputData, "shop_ids")?.Replace("'", "\\'");
|
||||
var search_shop_id = RegexUtils.GetStringQuery(ref inputData, "search_shop_id")?.Replace("'", "\\'");
|
||||
var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account")?.Replace("'", "\\'");
|
||||
var search_shop_account = RegexUtils.GetStringQuery(ref inputData, "search_shop_account");
|
||||
var search_spu = RegexUtils.GetStringQuery(ref inputData, "search_spu")?.Replace("'", "\\'");
|
||||
var search_skc = RegexUtils.GetStringQuery(ref inputData, "search_skc")?.Replace("'", "\\'");
|
||||
var search_cat = RegexUtils.GetStringQuery(ref inputData, "search_cat")?.Replace("'", "\\'");
|
||||
var search_ext_code = RegexUtils.GetStringQuery(ref inputData, "search_ext_code")?.Replace("'", "\\'");
|
||||
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name")?.Replace("'", "\\'");
|
||||
var search_prod_name = RegexUtils.GetStringQuery(ref inputData, "search_prod_name");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
|
||||
var search_user_notes = RegexUtils.GetStringQuery(ref inputData, "search_user_notes")?.Replace("'", "\\'");
|
||||
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
|
||||
var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
|
||||
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
|
||||
@@ -464,9 +456,11 @@ namespace KJD_Web.BLL
|
||||
if (!string.IsNullOrWhiteSpace(search_shop_id))
|
||||
where += " and s.shop_id like '%" + search_shop_id + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_shop_account))
|
||||
where += " and s.shop_account like '%" + search_shop_account + "%'";
|
||||
where += " and s.shop_account like @search_shop_account";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and s.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_user_notes))
|
||||
where += " and s.user_notes like '%" + search_user_notes + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
where += " and p.spu_id like '%" + search_spu + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
@@ -476,7 +470,7 @@ namespace KJD_Web.BLL
|
||||
if (!string.IsNullOrWhiteSpace(search_ext_code))
|
||||
where += " and p.ext_code like '%" + search_ext_code + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
where += " and p.product_name like '%" + search_prod_name + "%'";
|
||||
where += " and p.product_name like @search_prod_name";
|
||||
if (!string.IsNullOrEmpty(search_sub_sa_name))
|
||||
{
|
||||
where += " and (s.operate_sub_sa_name like '%" + search_sub_sa_name + "%'";
|
||||
@@ -485,7 +479,11 @@ namespace KJD_Web.BLL
|
||||
|
||||
sql += where;
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_shop_account", Value = "%" + search_shop_account + "%", });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@search_prod_name", Value = "%" + search_prod_name + "%", });
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql, paramLst.ToArray());
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
@@ -498,7 +496,7 @@ namespace KJD_Web.BLL
|
||||
//sql = "select * from kjd.third_product_select where 1=1";
|
||||
//else
|
||||
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
|
||||
"s.sub_user_name,s.notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
|
||||
"s.sub_user_name,s.notes,s.user_notes,s.status,s.draft_id,s.add_times,s.add_time,s.mdy_time," +
|
||||
"s.fission_product_name,s.operate_sub_sa_name,s.add_sub_sa_time," +
|
||||
"p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img," +
|
||||
"u.nick_name as operate_sub_sa_nick " +
|
||||
@@ -510,7 +508,7 @@ namespace KJD_Web.BLL
|
||||
|
||||
sql += " order by id desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
@@ -545,6 +543,7 @@ namespace KJD_Web.BLL
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
|
||||
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
|
||||
fission_product_name = row["fission_product_name"].ToString(),
|
||||
user_notes = row["user_notes"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
};
|
||||
@@ -668,10 +667,11 @@ namespace KJD_Web.BLL
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
|
||||
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"))?.Replace("'", "\\'");
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "db_id");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"));
|
||||
string user_notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "user_notes"));
|
||||
string fission_product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "fission_product_name"));
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
@@ -682,14 +682,19 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update kjd.third_product_select set";
|
||||
if (notes != null)
|
||||
sql += " notes='" + notes + "',";
|
||||
sql += " notes=@notes,";
|
||||
if (user_notes != null)
|
||||
sql += " user_notes=@user_notes,";
|
||||
if (fission_product_name != null)
|
||||
sql += " fission_product_name=@fission_product_name,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=" + id + ";";
|
||||
sql += " where id=@id;";
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "fission_product_name", Value = fission_product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "@id", Value = id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@fission_product_name", Value = fission_product_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@user_notes", Value = user_notes, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "@notes", Value = notes, });
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
mySql.Close();
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace KJD_Web.Model
|
||||
public string user_name { get; set; }
|
||||
public string sub_user_name { get; set; }
|
||||
public string notes { get; set; }
|
||||
public string user_notes { get; set; }
|
||||
public string status { get; set; }
|
||||
public string draft_id { get; set; }
|
||||
public int add_times { get; set; }
|
||||
|
||||
@@ -304,6 +304,14 @@ namespace KJD_Web.Utils
|
||||
return c;
|
||||
}
|
||||
|
||||
public int ExecuteRowCount(string SqlString, MySqlParameter[] parms)
|
||||
{
|
||||
string f = ExecuteFirst(SqlString, parms);
|
||||
int c;
|
||||
int.TryParse(f, out c);
|
||||
return c;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回第一个执行结果
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user