抖音小店准备阶段
This commit is contained in:
1 parent
9e0a3fc10c
commit
17e4dc4a3c
61 files changed
+5154
-1505
No files matched your search
@@ -158,8 +158,11 @@ namespace KJD_Web.BLL
|
||||
var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
|
||||
var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
|
||||
var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
|
||||
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level").ParseToInt();
|
||||
if (string.IsNullOrEmpty(product_get_type)) // 母店采集0或前端直采1
|
||||
product_get_type = "0";
|
||||
if (sa_level != 1 && product_get_type.ToLower() == "all")
|
||||
product_get_type = "0,1";
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
@@ -168,10 +171,10 @@ namespace KJD_Web.BLL
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(id) FROM kjd.product p WHERE p.is_del=0";
|
||||
if (!isDetail && product_get_type != "all")
|
||||
sql += " AND p.product_get_type=" + product_get_type;
|
||||
|
||||
string where = "";
|
||||
if (!isDetail && product_get_type != "all") // 详情必须从列表页面进入,不用限制
|
||||
where += " AND p.product_get_type in (" + product_get_type + ")";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
where += " AND p.id in (" + search_db_ids + ")";
|
||||
if (!string.IsNullOrWhiteSpace(search_group))
|
||||
@@ -183,7 +186,12 @@ namespace KJD_Web.BLL
|
||||
if (!string.IsNullOrWhiteSpace(search_cat))
|
||||
where += " AND p.cat_name like '%" + search_cat + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_ext_code))
|
||||
where += " AND p.ext_code like '%" + search_ext_code + "%'";
|
||||
{
|
||||
if (search_ext_code.Contains(","))
|
||||
where += " AND p.ext_code in ('" + search_ext_code.Replace(",", "','") + "')";
|
||||
else
|
||||
where += " AND p.ext_code like '%" + search_ext_code + "%'";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
where += " AND p.product_name like '%" + search_prod_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
@@ -227,9 +235,6 @@ namespace KJD_Web.BLL
|
||||
|
||||
//sql += "SELECT * FROM " + tableName + l_spu_map_table_id + " where draft_id=" + in_draft_id_list[i];
|
||||
|
||||
if (!isDetail && product_get_type != "all") // 详情必须从列表页面进入,不用限制
|
||||
sql += " AND p.product_get_type=" + product_get_type;
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
|
||||
@@ -324,6 +324,62 @@ namespace KJD_Web.BLL
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string MdyDBProduct(string inputData, bool isAdmin = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
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("'", "\\'");
|
||||
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 product_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_json"))?.Replace("'", "\\'");
|
||||
string size_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "size_json"))?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有指定商品\"}";
|
||||
}
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update kjd.third_product set";
|
||||
if (product_name != null)
|
||||
sql += " product_name='" + product_name + "',";
|
||||
if (notes != null)
|
||||
sql += " notes='" + notes + "',";
|
||||
if (ext_code != null)
|
||||
sql += " ext_code='" + ext_code + "',";
|
||||
if (product_json != null)
|
||||
sql += " product_json='" + product_json + "',";
|
||||
if (size_json != null)
|
||||
sql += " size_json='" + size_json + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where id=" + id + ";";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"更新失败:" + mySql.Message + "\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string AddUserSelectProduct(string inputData, bool isAdmin = false)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user