微信小店上传商品完成
This commit is contained in:
1 parent
0c2930bea5
commit
9e1a354ee5
35 files changed
+1965
-579
No files matched your search
@@ -40,8 +40,8 @@ namespace KJD_Web.BLL.BXX
|
||||
string main_img = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_img"))?.Replace("'", "\\'");
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
|
||||
string product_get_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_get_type"))?.Replace("'", "\\'");
|
||||
string sale_count = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_get_type"))?.Replace("'", "\\'");
|
||||
string sale_count_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_get_type"))?.Replace("'", "\\'");
|
||||
string sale_count = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count"))?.Replace("'", "\\'");
|
||||
string sale_count_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_text"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(product_get_type))
|
||||
{
|
||||
product_get_type = "母店采集";
|
||||
@@ -106,6 +106,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string notes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "notes"))?.Replace("'", "\\'");
|
||||
string sale_count = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count"))?.Replace("'", "\\'");
|
||||
string sale_count_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sale_count_text"))?.Replace("'", "\\'");
|
||||
string wx_safe_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_safe_status"))?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
@@ -147,6 +148,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += " p.sale_count='" + sale_count + "',";
|
||||
if (sale_count_text != null)
|
||||
sql += " p.sale_count_text='" + sale_count_text + "',";
|
||||
if (wx_safe_status != null)
|
||||
sql += " p.wx_safe_status='" + wx_safe_status + "',";
|
||||
sql += " p.mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where spu_id='" + spu_id + "';";
|
||||
@@ -188,6 +191,7 @@ namespace KJD_Web.BLL.BXX
|
||||
var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
|
||||
var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
|
||||
var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
|
||||
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
@@ -216,6 +220,8 @@ namespace KJD_Web.BLL.BXX
|
||||
where += " and p.from_shop_id ='" + from_shop_id + "'";
|
||||
if (!string.IsNullOrEmpty(product_get_type))
|
||||
where += " and p.product_get_type ='" + product_get_type + "'";
|
||||
if (!string.IsNullOrEmpty(wx_safe_status))
|
||||
where += " and p.wx_safe_status ='" + wx_safe_status + "'";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
where += " and p.id in (" + search_db_ids + ")";
|
||||
sql += where;
|
||||
@@ -236,7 +242,7 @@ namespace KJD_Web.BLL.BXX
|
||||
" where p.is_del=0";
|
||||
else if (string.IsNullOrEmpty(get_select_count))
|
||||
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.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type," +
|
||||
" p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,p.wx_safe_status," +
|
||||
" p.sale_count,p.sale_count_text,s.img_url,e.ext_code_price" +
|
||||
" FROM bxx.product p " +
|
||||
" left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
@@ -244,7 +250,7 @@ namespace KJD_Web.BLL.BXX
|
||||
" where p.is_del=0";
|
||||
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.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type," +
|
||||
" p.add_time,p.mdy_time,p.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,p.wx_safe_status," +
|
||||
" p.sale_count,p.sale_count_text,s.img_url,COUNT(se.id) AS select_count," +
|
||||
" e.ext_code_price" +
|
||||
" FROM bxx.product p left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
|
||||
@@ -300,6 +306,7 @@ namespace KJD_Web.BLL.BXX
|
||||
product_get_type_text = row["product_get_type"].ToString(),
|
||||
sale_count = row["sale_count"].ParseToInt(),
|
||||
sale_count_text = row["sale_count_text"].ToString(),
|
||||
wx_safe_status = row["wx_safe_status"].ToString(),
|
||||
};
|
||||
if (isDetail)
|
||||
{
|
||||
@@ -552,6 +559,7 @@ namespace KJD_Web.BLL.BXX
|
||||
var in_groups = RegexUtils.GetStringQuery(ref inputData, "in_groups")?.Replace("'", "\\'");
|
||||
var in_cates = RegexUtils.GetStringQuery(ref inputData, "in_cates")?.Replace("'", "\\'");
|
||||
var product_get_type = RegexUtils.GetStringQuery(ref inputData, "product_get_type")?.Replace("'", "\\'");
|
||||
var wx_safe_status = RegexUtils.GetStringQuery(ref inputData, "wx_safe_status")?.Replace("'", "\\'");
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
@@ -584,6 +592,8 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
if (!string.IsNullOrEmpty(product_get_type))
|
||||
where += " and p.product_get_type ='" + product_get_type + "'";
|
||||
if (!string.IsNullOrEmpty(wx_safe_status))
|
||||
where += " and p.wx_safe_status ='" + wx_safe_status + "'";
|
||||
|
||||
sql += where;
|
||||
|
||||
@@ -598,7 +608,7 @@ namespace KJD_Web.BLL.BXX
|
||||
{
|
||||
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.group,p.notes,p.add_time,p.mdy_time,p.select_total_count,p.product_get_type,p.sale_count,p.sale_count_text," +
|
||||
"p.fission_words,p.head_words,p.end_words from bxx.product p where p.is_del=0";
|
||||
"p.fission_words,p.head_words,p.end_words,p.wx_safe_status from bxx.product p where p.is_del=0";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
@@ -643,6 +653,7 @@ namespace KJD_Web.BLL.BXX
|
||||
product_get_type_text = row["product_get_type"].ParseToString(),
|
||||
sale_count = row["sale_count"].ParseToInt(),
|
||||
sale_count_text = row["sale_count_text"].ToString(),
|
||||
wx_safe_status = row["wx_safe_status"].ToString(),
|
||||
};
|
||||
productLst.Add(prod);
|
||||
}
|
||||
@@ -858,6 +869,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string head_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "head_words"))?.Replace("'", "\\'");
|
||||
string end_words = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "end_words"))?.Replace("'", "\\'");
|
||||
string sku_edit_json = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_edit_json"))?.Replace("'", "\\'");
|
||||
string wx_safe_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_safe_status"))?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
@@ -883,6 +895,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += " p.end_words='" + end_words + "',";
|
||||
if (sku_edit_json != null)
|
||||
sql += " p.sku_edit_json='" + sku_edit_json + "',";
|
||||
if (wx_safe_status != null)
|
||||
sql += " p.wx_safe_status='" + wx_safe_status + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
if (in_db_ids != null)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace KJD_Web.BLL
|
||||
{
|
||||
public class ProductThirdManage
|
||||
{
|
||||
public string AddProduct(string inputData)
|
||||
public string AddOrMdyProduct(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
|
||||
@@ -16,162 +16,164 @@ namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
public string WXGetPDDProductList(string inputData, bool isDetail = 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\":\"校验失败\"}";
|
||||
return new BLL.BXX.BXXProductManage().GetProductList(inputData, isDetail);
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
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_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
|
||||
var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
|
||||
var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
|
||||
var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'");
|
||||
var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
|
||||
var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
|
||||
var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
|
||||
//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\":\"校验失败\"}";
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
// var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'");
|
||||
// var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
// 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_group = RegexUtils.GetStringQuery(ref inputData, "search_group")?.Replace("'", "\\'");
|
||||
// var search_notes = RegexUtils.GetStringQuery(ref inputData, "search_notes")?.Replace("'", "\\'");
|
||||
// var search_db_ids = RegexUtils.GetStringQuery(ref inputData, "search_db_ids")?.Replace("'", "\\'");
|
||||
// var get_select_count = RegexUtils.GetStringQuery(ref inputData, "get_select_count")?.Replace("'", "\\'");
|
||||
// var select_shop_id = RegexUtils.GetStringQuery(ref inputData, "select_shop_id")?.Replace("'", "\\'");
|
||||
// var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.Replace("'", "\\'");
|
||||
// var sort_field = RegexUtils.GetStringQuery(ref inputData, "sort_field")?.Replace("'", "\\'");
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
// int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
// int page_size= RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
|
||||
string sql = "select count(id) from bxx.product p where p.is_del=0";
|
||||
// string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
// MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
where += " and p.spu_id like '%" + search_spu + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
where += " and p.skc_id like '%" + search_skc + "%'";
|
||||
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 (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
where += " and p.product_name like '%" + search_prod_name + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_group))
|
||||
where += " and p.group like '%" + search_group + "%'";
|
||||
if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
where += " and p.notes like '%" + search_notes + "%'";
|
||||
if (!string.IsNullOrEmpty(from_shop_id))
|
||||
where += " and p.from_shop_id ='" + from_shop_id + "'";
|
||||
if (!string.IsNullOrEmpty(search_db_ids))
|
||||
where += " and p.id in (" + search_db_ids + ")";
|
||||
sql += where;
|
||||
// string sql = "select count(id) from bxx.product p where p.is_del=0";
|
||||
|
||||
var count = mySql.ExecuteRowCount(sql);
|
||||
// string where = "";
|
||||
// if (!string.IsNullOrWhiteSpace(search_spu))
|
||||
// where += " and p.spu_id like '%" + search_spu + "%'";
|
||||
// if (!string.IsNullOrWhiteSpace(search_skc))
|
||||
// where += " and p.skc_id like '%" + search_skc + "%'";
|
||||
// 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 (!string.IsNullOrWhiteSpace(search_prod_name))
|
||||
// where += " and p.product_name like '%" + search_prod_name + "%'";
|
||||
// if (!string.IsNullOrWhiteSpace(search_group))
|
||||
// where += " and p.group like '%" + search_group + "%'";
|
||||
// if (!string.IsNullOrWhiteSpace(search_notes))
|
||||
// where += " and p.notes like '%" + search_notes + "%'";
|
||||
// if (!string.IsNullOrEmpty(from_shop_id))
|
||||
// where += " and p.from_shop_id ='" + from_shop_id + "'";
|
||||
// if (!string.IsNullOrEmpty(search_db_ids))
|
||||
// where += " and p.id in (" + search_db_ids + ")";
|
||||
// sql += where;
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isDetail)
|
||||
sql = "select p.*,s.img_base64,s.img_url,e.ext_code_price from bxx.product p" +
|
||||
" left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
" where p.is_del=0";
|
||||
else if (string.IsNullOrEmpty(get_select_count))
|
||||
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.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,s.img_url,e.ext_code_price" +
|
||||
" FROM bxx.product p " +
|
||||
" left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
" where p.is_del=0";
|
||||
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.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,s.img_url,COUNT(se.id) AS select_count," +
|
||||
" e.ext_code_price" +
|
||||
" FROM bxx.product p left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
|
||||
" LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
" WHERE p.is_del=0";
|
||||
// var count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
// DataTable dt;
|
||||
// if (count == 0)
|
||||
// {
|
||||
// dt = new DataTable();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (isDetail)
|
||||
// sql = "select p.*,s.img_base64,s.img_url,e.ext_code_price from bxx.product p" +
|
||||
// " left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
// " LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
// " where p.is_del=0";
|
||||
// else if (string.IsNullOrEmpty(get_select_count))
|
||||
// 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.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,s.img_url,e.ext_code_price" +
|
||||
// " FROM bxx.product p " +
|
||||
// " left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id" +
|
||||
// " LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
// " where p.is_del=0";
|
||||
// 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.select_total_count,p.fission_words,p.head_words,p.end_words,p.sku_img_replace_id,p.group,p.product_get_type,s.img_url,COUNT(se.id) AS select_count," +
|
||||
// " e.ext_code_price" +
|
||||
// " FROM bxx.product p left join bxx.sku_img_replace s ON p.sku_img_replace_id=s.id LEFT JOIN bxx.product_select se ON p.id=se.out_product_id AND se.shop_id='" + select_shop_id + "' " +
|
||||
// " LEFT JOIN bxx.ext_code_price e ON p.ext_code=e.ext_code" +
|
||||
// " WHERE p.is_del=0";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
// //where子句
|
||||
// sql += where;
|
||||
|
||||
if (!isDetail && !string.IsNullOrEmpty(get_select_count))
|
||||
sql += " group by p.id";
|
||||
if (sort_field == "select_total_count")
|
||||
sql += " order by p.select_total_count desc, p.id desc";
|
||||
else
|
||||
sql += " order by p.id desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
// if (!isDetail && !string.IsNullOrEmpty(get_select_count))
|
||||
// sql += " group by p.id";
|
||||
// if (sort_field == "select_total_count")
|
||||
// sql += " order by p.select_total_count desc, p.id desc";
|
||||
// else
|
||||
// sql += " order by p.id desc";
|
||||
// sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
// dt = mySql.ExecuteDataTable(sql);
|
||||
// }
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<DBProductResultParam> productLst = new List<DBProductResultParam>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
DBProductResultParam prod = new DBProductResultParam
|
||||
{
|
||||
id = Convert.ToInt32(row["id"]),
|
||||
from_shop_id = row["from_shop_id"].ToString(),
|
||||
skc_id = row["skc_id"].ToString(),
|
||||
spu_id = row["spu_id"].ToString(),
|
||||
cat_id = row["cat_id"].ToString(),
|
||||
cat_name = row["cat_name"].ToString(),
|
||||
product_name = row["product_name"].ToString(),
|
||||
main_img = row["main_img"].ToString(),
|
||||
ext_code = row["ext_code"].ToString(),
|
||||
ext_code_price = row["ext_code_price"].IsNullOrEmpty() ? new int?() : row["ext_code_price"].ParseToInt(),
|
||||
price_text = row["price_text"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
notes = row["notes"].ToString(),
|
||||
group = row["group"].ToString(),
|
||||
select_total_count = row["select_total_count"].ParseToInt(),
|
||||
end_words = row["end_words"].ParseToString(),
|
||||
fission_words = row["fission_words"].ParseToString(),
|
||||
head_words = row["head_words"].ParseToString(),
|
||||
sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
|
||||
sku_img_replace_url = row["img_url"].ToString(),
|
||||
product_get_type_text = row["product_get_type"].ToString(),
|
||||
};
|
||||
if (isDetail)
|
||||
{
|
||||
prod.product_json = row["product_json"].ToString();
|
||||
prod.size_json = row["size_json"].ToString();
|
||||
prod.sku_edit_json = row["sku_edit_json"].ToString();
|
||||
prod.sku_img_replace_base64 = row["img_base64"].ToString();
|
||||
//prod.sku_img_replace_url = row["img_url"].ToString();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(get_select_count))
|
||||
{
|
||||
prod.select_count = row["select_count"].ParseToInt();
|
||||
}
|
||||
productLst.Add(prod);
|
||||
}
|
||||
var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
// mySql.Close();
|
||||
// if (dt != null)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// List<DBProductResultParam> productLst = new List<DBProductResultParam>();
|
||||
// foreach (DataRow row in dt.Rows)
|
||||
// {
|
||||
// DBProductResultParam prod = new DBProductResultParam
|
||||
// {
|
||||
// id = Convert.ToInt32(row["id"]),
|
||||
// from_shop_id = row["from_shop_id"].ToString(),
|
||||
// skc_id = row["skc_id"].ToString(),
|
||||
// spu_id = row["spu_id"].ToString(),
|
||||
// cat_id = row["cat_id"].ToString(),
|
||||
// cat_name = row["cat_name"].ToString(),
|
||||
// product_name = row["product_name"].ToString(),
|
||||
// main_img = row["main_img"].ToString(),
|
||||
// ext_code = row["ext_code"].ToString(),
|
||||
// ext_code_price = row["ext_code_price"].IsNullOrEmpty() ? new int?() : row["ext_code_price"].ParseToInt(),
|
||||
// price_text = row["price_text"].ToString(),
|
||||
// //product_json = row["product_json"].ToString(),
|
||||
// //size_json = row["size_json"].ToString(),
|
||||
// add_time = Convert.ToDateTime(row["add_time"]),
|
||||
// mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
// notes = row["notes"].ToString(),
|
||||
// group = row["group"].ToString(),
|
||||
// select_total_count = row["select_total_count"].ParseToInt(),
|
||||
// end_words = row["end_words"].ParseToString(),
|
||||
// fission_words = row["fission_words"].ParseToString(),
|
||||
// head_words = row["head_words"].ParseToString(),
|
||||
// sku_img_replace_id = row["sku_img_replace_id"].ParseToInt(),
|
||||
// sku_img_replace_url = row["img_url"].ToString(),
|
||||
// product_get_type_text = row["product_get_type"].ToString(),
|
||||
// };
|
||||
// if (isDetail)
|
||||
// {
|
||||
// prod.product_json = row["product_json"].ToString();
|
||||
// prod.size_json = row["size_json"].ToString();
|
||||
// prod.sku_edit_json = row["sku_edit_json"].ToString();
|
||||
// prod.sku_img_replace_base64 = row["img_base64"].ToString();
|
||||
// //prod.sku_img_replace_url = row["img_url"].ToString();
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(get_select_count))
|
||||
// {
|
||||
// prod.select_count = row["select_count"].ParseToInt();
|
||||
// }
|
||||
// productLst.Add(prod);
|
||||
// }
|
||||
// var data = JsonUtils.SerializerObjectToString(productLst);
|
||||
// return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
// }
|
||||
//}
|
||||
//return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetPDDProductGroups(string inputData)
|
||||
@@ -289,6 +291,8 @@ namespace KJD_Web.BLL.WXXD
|
||||
/// <returns></returns>
|
||||
public string WXGetPDDProductListRandom(string inputData)
|
||||
{
|
||||
return new BXX.BXXProductManage().GetProductListRandom(inputData);
|
||||
/*
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
@@ -405,6 +409,12 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
*/
|
||||
}
|
||||
|
||||
public String WXMdyPDDProduct(string inputData)
|
||||
{
|
||||
return new BXX.BXXProductManage().MdyProduct(inputData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
|
||||
@@ -75,5 +75,6 @@ namespace KJD_Web.Model
|
||||
|
||||
public int sale_count { get; set; }
|
||||
public string sale_count_text { get; set; }
|
||||
public string wx_safe_status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ namespace KJD_Web
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new ProductThirdManage().AddProduct(jsontext);
|
||||
result = new ProductThirdManage().AddOrMdyProduct(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
|
||||
@@ -109,5 +109,17 @@ namespace KJD_Web
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_pdd_product()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXProductManage().WXMdyPDDProduct(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user