微信筛选店铺 店铺分组 运费加价
This commit is contained in:
1 parent
b4fa5cacb1
commit
afaabea1fa
33 files changed
+1338
-536
No files matched your search
@@ -252,7 +252,8 @@ namespace KJD_Web.BLL.WXXD
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT DISTINCT p.cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
//string sql = "SELECT DISTINCT p.cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
string sql = "SELECT DISTINCT p.main_cat_name FROM `bxx`.`product` p where p.is_del=0";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
@@ -267,7 +268,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
string group_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
group_data += row["cat_name"].ToString() + ",";
|
||||
group_data += row["main_cat_name"].ToString() + ",";
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\"}";
|
||||
@@ -530,6 +531,137 @@ namespace KJD_Web.BLL.WXXD
|
||||
break;
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
if (data.IsNullOrEmpty())
|
||||
data = "\"\"";
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string WXAddMdyShippingTemplate(string inputData)
|
||||
{
|
||||
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("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
//int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
//int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
string coid = RegexUtils.GetStringQuery(ref inputData, "coid")?.Replace("'", "\\'");
|
||||
string shipping_template_json = RegexUtils.GetStringQuery(ref inputData, "shipping_template_json")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty("coid"))
|
||||
return "{\"code\":50001,\"msg\":\"没有运费编号\"}";
|
||||
if (string.IsNullOrEmpty("shipping_template_json"))
|
||||
return "{\"code\":50001,\"msg\":\"没有运费信息\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT * FROM `wxxd`.`shipping_template` where coid='" + coid + "'";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
mySql = new MysqlUtils(conn);
|
||||
if (dt.Rows.Count == 0)
|
||||
{
|
||||
sql = "INSERT INTO `wxxd`.`shipping_template` (coid,shipping_template_json) VALUES (@coid,@shipping_template_json);";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "UPDATE `wxxd`.`shipping_template` SET shipping_template_json=@shipping_template_json WHERE coid=@coid;";
|
||||
}
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "coid", Value = coid, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shipping_template_json", Value = shipping_template_json, });
|
||||
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
mySql.Close();
|
||||
if (string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetShippingTemplate(string inputData)
|
||||
{
|
||||
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("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
//int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
//int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
string coid = RegexUtils.GetStringQuery(ref inputData, "coid")?.Replace("'", "\\'");
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT * FROM `wxxd`.`shipping_template` where coid='" + coid + "'";
|
||||
|
||||
string where = "";
|
||||
sql += where;
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string group_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
group_data += row["shipping_template_json"].ToString();
|
||||
break;
|
||||
}
|
||||
var data = group_data.Trim(',');
|
||||
if (data.IsNullOrEmpty())
|
||||
data = "\"\"";
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
else
|
||||
{
|
||||
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.openid,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.user_name,s.company_name,s.notes,s.group_name,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 wxxd.shop s WHERE 1=1";
|
||||
sql += " FROM wxxd.shop s LEFT JOIN wxxd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
|
||||
@@ -133,6 +133,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
add_product_month = row["add_product_month"].ParseToInt(),
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
|
||||
openid = row["openid"].ParseToString(),
|
||||
group_name = row["group_name"].ParseToString(),
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
@@ -274,7 +275,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
else
|
||||
{
|
||||
sql = "SELECT s.id,s.login_name,s.login_pass,s.cookie,s.cookie2,s.anti_contents,s.shop_id,s.openid,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.company_name,s.notes,s.group_name,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 wxxd.shop s LEFT JOIN wxxd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
|
||||
|
||||
@@ -311,6 +312,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
add_product_month = row["add_product_month"].ParseToInt(),
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
|
||||
openid = row["openid"].ToString(),
|
||||
group_name = row["group_name"].ToString(),
|
||||
};
|
||||
shopList.Add(shop);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user