拼多多商品获取逻辑
This commit is contained in:
1 parent
840636d5c9
commit
6639224771
68 files changed
+7132
-692
No files matched your search
@@ -24,6 +24,7 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
string from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id");
|
||||
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");
|
||||
@@ -44,8 +45,8 @@ namespace KJD_Web.BLL.BXX
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
|
||||
sql = "insert into bxx.product (spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,add_time,mdy_time) " +
|
||||
"values ('" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" +
|
||||
sql = "insert into bxx.product (from_shop_id,spu_id,skc_id,cat_id,cat_name,product_name,ext_code,main_img,product_json,size_json,notes,add_time,mdy_time) " +
|
||||
"values ('" + from_shop_id + "','" + spu_id + "','" + skc_id + "','" + cat_id + "','" + cat_name + "','" + product_name + "','" +
|
||||
ext_code + "','" + main_img + "','" + product_json + "','" + size_json + "','" + notes + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
@@ -63,6 +64,74 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string MdyProduct(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
string from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id");
|
||||
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("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "";
|
||||
|
||||
sql = "update bxx.product set";
|
||||
if (from_shop_id != null)
|
||||
sql += " from_shop_id='" + from_shop_id + "',";
|
||||
if (cat_id != null)
|
||||
sql += " cat_id='" + cat_id + "',";
|
||||
if (cat_name != null)
|
||||
sql += " cat_name='" + cat_name + "',";
|
||||
if (product_name != null)
|
||||
sql += " product_name='" + product_name + "',";
|
||||
if (ext_code != null)
|
||||
sql += " ext_code='" + ext_code + "',";
|
||||
if (main_img != null)
|
||||
sql += " main_img='" + main_img + "',";
|
||||
if (product_json != null)
|
||||
sql += " product_json='" + product_json + "',";
|
||||
if (size_json != null)
|
||||
sql += " size_json='" + size_json + "',";
|
||||
if (notes != null)
|
||||
sql += " notes='" + notes + "',";
|
||||
sql += " mdy_time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where spu_id='" + spu_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 GetProductList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -122,10 +191,10 @@ namespace KJD_Web.BLL.BXX
|
||||
if (isDetail)
|
||||
sql = "select * from bxx.product p where 1=1";
|
||||
else if (string.IsNullOrEmpty(get_select_count))
|
||||
sql = "select p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
sql = "select p.id,p.from_shop_id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,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 from bxx.product p where 1=1";
|
||||
else
|
||||
sql = "SELECT p.id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.ext_code,p.product_name,p.main_img,p.notes," +
|
||||
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,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,COUNT(s.id) AS select_count " +
|
||||
"FROM bxx.product p LEFT JOIN bxx.product_select s ON p.id=s.out_product_id AND s.shop_id='" + select_shop_id + "' " +
|
||||
"WHERE 1=1";
|
||||
@@ -153,6 +222,7 @@ namespace KJD_Web.BLL.BXX
|
||||
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(),
|
||||
@@ -363,9 +433,9 @@ namespace KJD_Web.BLL.BXX
|
||||
{
|
||||
add_product_remaining = add_product_remaining - 1;
|
||||
sql += "\r\n";
|
||||
sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
|
||||
sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
|
||||
sql += "update bxx.product set select_total_count=select_total_count+1 where id=" + out_product_Id + ";";
|
||||
//sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
|
||||
//sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
|
||||
sql += "INSERT INTO bxx.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)";
|
||||
}
|
||||
@@ -557,7 +627,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
|
||||
"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," +
|
||||
"p.from_shop_id,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 " +
|
||||
"from bxx.product_select s left join bxx.product p on s.out_product_id=p.id " +
|
||||
"left join bxx.user u on u.user_name=s.operate_sub_sa_name " +
|
||||
@@ -603,6 +673,7 @@ namespace KJD_Web.BLL.BXX
|
||||
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
|
||||
fission_product_name = row["fission_product_name"].ToString(),
|
||||
user_notes = row["user_notes"].ToString(),
|
||||
from_shop_id = row["from_shop_id"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
|
||||
@@ -25,6 +26,7 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "user_name");
|
||||
string from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id");
|
||||
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");
|
||||
@@ -44,28 +46,33 @@ namespace KJD_Web.BLL.BXX
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
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);
|
||||
var product_md5_2 = EncrypUtil.GetMd5(product_json?.Replace("'", "\\'").Replace(json_sign, "") + size_json);
|
||||
sql = "select id from bxx.third_product where product_md5='" + product_md5 + "' or product_md5='" + product_md5_2 + "';";
|
||||
var json_ids = RegexUtils.GetMatchRegex(ref product_json, "(\"id\":\\d{8,14})"); // 取商品json数据里不同签名的部分
|
||||
var product_json_replace = product_json;
|
||||
foreach (Match json_id in json_ids)
|
||||
{
|
||||
product_json_replace = product_json_replace.Replace(json_id.Value, "\"id\":0");
|
||||
}
|
||||
var product_md5 = EncrypUtil.GetMd5(product_json_replace + size_json);
|
||||
sql = "select id from bxx.third_product where product_md5='" + product_md5 + "';";
|
||||
var rst = mySql.ExecuteFirstInt(sql).ParseToLong();
|
||||
if (rst <= 0)
|
||||
{
|
||||
//sql = "insert into bxx.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 + "','" +
|
||||
//sql = "insert into bxx.third_product (from_shop_id,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 ('" + from_shop_id + "','" + 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 bxx.third_product (spu_id,skc_id,cat_id,cat_name,product_name," +
|
||||
sql = "insert into bxx.third_product (from_shop_id,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," +
|
||||
"values (@from_shop_id,@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);";
|
||||
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 = "@from_shop_id", Value = from_shop_id, });
|
||||
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, });
|
||||
@@ -105,6 +112,7 @@ namespace KJD_Web.BLL.BXX
|
||||
|
||||
var user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'","\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var from_shop_id = RegexUtils.GetStringQuery(ref inputData, "from_shop_id")?.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("'", "\\'");
|
||||
@@ -150,7 +158,7 @@ namespace KJD_Web.BLL.BXX
|
||||
if (isDetail)
|
||||
sql = "select * from bxx.third_product where 1=1";
|
||||
else
|
||||
sql = "select id,spu_id,skc_id,cat_id,cat_name,change_cat_id,change_cat_name,ext_code,product_name,main_img,notes," +
|
||||
sql = "select id,from_shop_id,spu_id,skc_id,cat_id,cat_name,change_cat_id,change_cat_name,ext_code,product_name,main_img,notes," +
|
||||
"add_time,mdy_time from bxx.third_product where 1=1";
|
||||
|
||||
sql += where;
|
||||
@@ -171,6 +179,7 @@ namespace KJD_Web.BLL.BXX
|
||||
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(),
|
||||
@@ -361,7 +370,7 @@ namespace KJD_Web.BLL.BXX
|
||||
{
|
||||
add_product_remaining = add_product_remaining - 1;
|
||||
sql += "\r\n";
|
||||
sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
|
||||
sql += "update bxx.shop set add_product_remaining=" + add_product_remaining + " where shop_id='" + shop_id + "';";
|
||||
//sql += "update bxx.shop_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
|
||||
sql += "INSERT INTO bxx.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)";
|
||||
@@ -558,7 +567,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sql = "select s.id,s.out_product_id,s.shop_id,s.shop_account,s.user_name," +
|
||||
"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.change_cat_id,p.change_cat_name,p.ext_code,p.product_name,p.main_img," +
|
||||
"p.from_shop_id,p.spu_id,p.skc_id,p.cat_id,p.cat_name,p.change_cat_id,p.change_cat_name,p.ext_code,p.product_name,p.main_img," +
|
||||
"u.nick_name as operate_sub_sa_nick " +
|
||||
"from bxx.third_product_select s left join bxx.third_product p on s.out_product_id=p.id " +
|
||||
"left join bxx.user u on u.user_name=s.operate_sub_sa_name " +
|
||||
@@ -606,6 +615,7 @@ namespace KJD_Web.BLL.BXX
|
||||
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
|
||||
fission_product_name = row["fission_product_name"].ToString(),
|
||||
user_notes = row["user_notes"].ToString(),
|
||||
from_shop_id = row["from_shop_id"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
};
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
else
|
||||
{
|
||||
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," +
|
||||
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," +
|
||||
"s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," +
|
||||
"s.add_sub_sa_time,s.operate_sub_sa_name";
|
||||
//sql += " FROM bxx.shop s WHERE 1=1";
|
||||
@@ -120,6 +120,7 @@ namespace KJD_Web.BLL.BXX
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
@@ -272,7 +273,7 @@ namespace KJD_Web.BLL.BXX
|
||||
}
|
||||
else
|
||||
{
|
||||
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," +
|
||||
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.shop_id,s.shop_account,s.sub_user_name,s.user_name," +
|
||||
"s.company_name,s.notes,s.login_status,s.login_status2,c.add_product_remaining,c.add_product_month,s.add_time,s.mdy_time," +
|
||||
"s.add_sub_sa_time,s.operate_sub_sa_name";
|
||||
sql += " FROM bxx.shop s LEFT JOIN bxx.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
|
||||
@@ -297,6 +298,7 @@ namespace KJD_Web.BLL.BXX
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
@@ -425,7 +427,7 @@ namespace KJD_Web.BLL.BXX
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name from bxx.shop where user_name='"
|
||||
string sql = "select id,login_name,login_pass,cookie,cookie2,anti_contents,shop_id,shop_account,sub_user_name,user_name from bxx.shop where user_name='"
|
||||
+ user_name + "' and login_name='" + login_name + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
@@ -442,6 +444,7 @@ namespace KJD_Web.BLL.BXX
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
@@ -473,7 +476,7 @@ namespace KJD_Web.BLL.BXX
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select id,login_name,login_pass,cookie,cookie2,shop_id,shop_account,sub_user_name,user_name from bxx.shop where user_name='"
|
||||
string sql = "select id,login_name,login_pass,cookie,cookie2,anti_contents,shop_id,shop_account,sub_user_name,user_name from bxx.shop where user_name='"
|
||||
+ user_name + "' and login_name='" + login_name + "' and shop_id='" + shop_id + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
@@ -490,6 +493,7 @@ namespace KJD_Web.BLL.BXX
|
||||
login_pass = row["login_pass"].ToString(),
|
||||
cookie = row["cookie"].ToString(),
|
||||
cookie2 = row["cookie2"].ToString(),
|
||||
anti_contents = row["anti_contents"].ToString(),
|
||||
shop_id = row["shop_id"].ToString(),
|
||||
shop_account = row["shop_account"].ToString(),
|
||||
sub_user_name = row["sub_user_name"].ToString(),
|
||||
@@ -519,6 +523,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
|
||||
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
|
||||
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
|
||||
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
|
||||
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
|
||||
string group_name = RegexUtils.GetStringQuery(ref inputData, "group_name");
|
||||
@@ -550,8 +555,8 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":500,\"msg\":\"店铺" + login_name +" " + shop_account + "已存在\"}";
|
||||
}
|
||||
|
||||
sql = "insert into bxx.shop (login_name,login_pass,cookie,cookie2,shop_account,shop_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " +
|
||||
"values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + shop_account + "','" + shop_id + "','" +
|
||||
sql = "insert into bxx.shop (login_name,login_pass,cookie,cookie2,anti_contents,shop_account,shop_id,sub_user_name,user_name,group_name,notes,add_time,mdy_time) " +
|
||||
"values ('" + login_name + "','" + login_pass + "','" + cookie + "','" + cookie2 + "','" + anti_contents + "','" + shop_account + "','" + shop_id + "','" +
|
||||
sub_user_name + "','" + user_name + "','" + group_name + "','" + notes + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
|
||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
|
||||
@@ -577,6 +582,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string sub_user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sub_user_name"));
|
||||
string cookie = RegexUtils.GetStringQuery(ref inputData, "cookie");
|
||||
string cookie2 = RegexUtils.GetStringQuery(ref inputData, "cookie2");
|
||||
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
|
||||
string new_shop_id = RegexUtils.GetStringQuery(ref inputData, "new_shop_id");
|
||||
string old_shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string shop_account = RegexUtils.GetStringQuery(ref inputData, "shop_account");
|
||||
@@ -605,6 +611,8 @@ namespace KJD_Web.BLL.BXX
|
||||
sql += " cookie='" + cookie + "',";
|
||||
if (cookie2 != null)
|
||||
sql += " cookie2='" + cookie2 + "',";
|
||||
if (anti_contents != null)
|
||||
sql += " anti_contents='" + anti_contents + "',";
|
||||
if (new_shop_id != null)
|
||||
sql += " shop_id='" + new_shop_id + "',";
|
||||
if (shop_account != null)
|
||||
@@ -632,6 +640,40 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string MdyAntiContent(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
string login_name = RegexUtils.GetStringQuery(ref inputData, "login_name");
|
||||
string shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id");
|
||||
string anti_contents = RegexUtils.GetStringQuery(ref inputData, "anti_contents");
|
||||
|
||||
int r2 = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
|
||||
|
||||
if (string.IsNullOrEmpty(login_name))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"店铺没有登录名\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "update bxx.shop set";
|
||||
if (anti_contents != null)
|
||||
sql += " anti_contents='" + anti_contents + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where login_name='" + login_name + "' and shop_id='" + shop_id + "';";
|
||||
|
||||
var rst = mySql.ExecuteNonQuery(sql);
|
||||
mySql.Close();
|
||||
if (rst)
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
public string MdyCookieAndLoginStatus(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
|
||||
@@ -363,7 +363,7 @@ 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 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_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 + ")" +
|
||||
|
||||
@@ -361,8 +361,8 @@ 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_add_prod_count set add_product_remaining=" + add_product_remaining + " where shop_id=" + shop_id + ";";
|
||||
sql += "update kjd.shop 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)";
|
||||
}
|
||||
|
||||
@@ -84,6 +84,18 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_product()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().MdyProduct(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void del_db_product()
|
||||
{
|
||||
|
||||
@@ -108,6 +108,18 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_anti_content()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXShopManage().MdyAntiContent(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void mdy_shop_cookie_and_login_status()
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace KJD_Web.Model
|
||||
public class DBProductResultParam
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string from_shop_id { get; set; } = "";
|
||||
public string spu_id { get; set; }
|
||||
public string skc_id { get; set; }
|
||||
public string cat_id { get; set; }
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace KJD_Web.Model
|
||||
public string fission_product_name { get; set; }
|
||||
|
||||
#region 外键连接属性
|
||||
|
||||
public string from_shop_id { get; set; } = "";
|
||||
public string cat_id { get; set; }
|
||||
public string cat_name { get; set; }
|
||||
public string change_cat_id { get; set; }
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace KJD_Web.Model.ShopModel
|
||||
public string login_pass { get; set; }
|
||||
public string cookie { get; set; }
|
||||
public string cookie2 { get; set; }
|
||||
public string anti_contents { get; set; }
|
||||
public string shop_id { get; set; }
|
||||
public string shop_account { get; set; }
|
||||
public string sub_user_name { get; set; }
|
||||
|
||||
Reference in new issue
Block a user