1.界面优化调整 2.618取消活动 3.清理无流量新 4.用户商品库1688及拼多多外部商品入库逻辑优化 5.带百分号的属性微信上货优化 6.数据库产品在不同用户间迁移 7.删除店铺功能开放给充值用户防止店铺导入错误无法删除

This commit is contained in:
wule committed 2026-06-11 11:38:08 +08:00
1 parent 2759ff0f6d
commit 0a9980335f
59 files changed
+3078 -652

No files matched your search

@@ -701,9 +701,9 @@ namespace KJD_Web.BLL.BXX
if (!string.IsNullOrEmpty(has_wx_cat))
{
if (has_wx_cat.ToLower() == "true")
where += " and wx_cat_leaf is NOT NULL";
where += " and wx_cat_leaf is NOT NULL and wx_cat_3 IS NOT NULL";
else
where += " and wx_cat_leaf is NULL";
where += " and (wx_cat_leaf is NULL OR wx_cat_3 IS NULL)";
}
if (!string.IsNullOrEmpty(send_to_out_server))
where += " and send_to_out_server=" + send_to_out_server;
@@ -721,10 +721,10 @@ namespace KJD_Web.BLL.BXX
// where += " and wx_cat_leaf IS NOT NULL and send_to_out_server=1 and delivery_fee_set=1 and after_sale_set=1 and distribution_set=1";
//else
// where += " and (wx_cat_leaf IS NULL or send_to_out_server=0 or delivery_fee_set=0 or after_sale_set=0 or distribution_set=0)";
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "已设置")
where += " and wx_cat_leaf IS NOT NULL and send_to_out_server=1 and distribution_set=1";
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "是" || is_supplier_prod_ok == "已设置")
where += " and wx_cat_leaf IS NOT NULL and send_to_out_server IN (1,127) and distribution_set IN (1,127)";
else
where += " and (wx_cat_leaf IS NULL or send_to_out_server!=1 or distribution_set=0)";
where += " and (wx_cat_leaf IS NULL or send_to_out_server NOT IN (1,127) or distribution_set NOT IN (1,127))";
}
if (!string.IsNullOrEmpty(real_coid))
{
@@ -1296,7 +1296,7 @@ namespace KJD_Web.BLL.BXX
string sql = "SELECT DISTINCT p.group FROM `bxx`.`product` p where p.is_del=0";
string where = "";
string where = " AND p.group NOT LIKE '用户%'";
if (!string.IsNullOrEmpty(product_get_type))
where += " and p.product_get_type in ('" + product_get_type.Replace(",", "','") + "')";
if (!string.IsNullOrEmpty(add_user_name))
@@ -1644,9 +1644,9 @@ namespace KJD_Web.BLL.BXX
if (!string.IsNullOrEmpty(is_supplier_prod_ok))
{
if (is_supplier_prod_ok == "1" || is_supplier_prod_ok == "是" || is_supplier_prod_ok == "已设置")
where += " and wx_cat_leaf IS NOT NULL and send_to_out_server=1 and distribution_set=1";
where += " AND wx_cat_leaf IS NOT NULL AND send_to_out_server IN (1,127) and distribution_set IN (1,127)";
else
where += " and (wx_cat_leaf IS NULL or send_to_out_server!=1 or distribution_set=0)";
where += " AND (wx_cat_leaf IS NULL OR send_to_out_server NOT IN (1,127) OR distribution_set NOT IN (1,127))";
}
if (!add_days_less.IsNullOrZero())
{
@@ -91,6 +91,7 @@ namespace KJD_Web.BLL.WXXD
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
parent_user_name = row["parent_user_name"].ToString(),
points = row.Table.Columns.Contains("points") ? row["points"].ParseToInt() : 0,
shop_points_per_month = row.Table.Columns.Contains("shop_points_per_month") ? row["shop_points_per_month"].ParseToInt() : 30,
};
var main_authority = row.Table.Columns.Contains("main_authority") ? row["main_authority"].ParseToString() : "";
// 子账号积分用户权限跟随
@@ -164,8 +165,8 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into wxxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,authority,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
sql = "INSERT into wxxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,parent_user_name,authority,add_time,mdy_time) " +
"VALUES ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "','" + parent_user_name + "','" + authority + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
@@ -328,6 +329,11 @@ namespace KJD_Web.BLL.WXXD
var group_id = RegexUtils.GetStringQuery(ref inputData, "group_id")?.Replace("'", "\\'");
var search = RegexUtils.GetStringQuery(ref inputData, "search")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var search_user_name = RegexUtils.GetStringQuery(ref inputData, "search_user_name")?.Replace("'", "\\'");
var search_nick_name = RegexUtils.GetStringQuery(ref inputData, "search_nick_name")?.Replace("'", "\\'");
var search_company_name = RegexUtils.GetStringQuery(ref inputData, "search_company_name")?.Replace("'", "\\'");
var search_authoritys_and = RegexUtils.GetStringQuery(ref inputData, "search_authoritys_and")?.Replace("'", "\\'");
var search_authoritys_or = RegexUtils.GetStringQuery(ref inputData, "search_authoritys_or")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
@@ -336,15 +342,47 @@ namespace KJD_Web.BLL.WXXD
//string sql = "select * from wxxd.user where group_id=3";
string sql = "select u.*,uu.authority as main_authority from wxxd.user u " +
"LEFT JOIN wxxd.user uu ON uu.user_name=u.parent_user_name WHERE 1=1";
string where = "";
if (!string.IsNullOrEmpty(group_id))
sql += " and u.group_id=" + group_id;
where += " AND u.group_id=" + group_id;
if (!string.IsNullOrEmpty(sa_level))
sql += " and u.sa_level=" + sa_level;
where += " AND u.sa_level=" + sa_level;
if (!string.IsNullOrEmpty(search_user_name))
where += " AND u.user_name like '%" + search_user_name + "%'";
if (!string.IsNullOrEmpty(search_nick_name))
where += " AND u.nick_name like '%" + search_nick_name + "%'";
if (!string.IsNullOrEmpty(search_company_name))
where += " AND u.company_name like '%" + search_company_name + "%'";
if (!string.IsNullOrEmpty(search_authoritys_and))
{
var search_authority_list = search_authoritys_and.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
foreach (var auth in search_authority_list)
{
where += " AND u.authority like '%" + auth + "%'";
}
}
if (!string.IsNullOrEmpty(search_authoritys_or))
{
where += " AND (";
var search_authority_list = search_authoritys_or.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList();
int index = 0;
foreach (var auth in search_authority_list)
{
if (index == 0)
where += " u.authority like '%" + auth + "%'";
else
where += " or u.authority like '%" + auth + "%'";
index++;
}
where += " )";
}
if (!string.IsNullOrEmpty(search))
sql += " and (u.user_name like '%" + search +
where += " AND (u.user_name like '%" + search +
"%' or u.nick_name like '%" + search +
"%' or u.company_name like '%" + search + "%')";
sql += " order by u.id desc";
sql += where;
sql += " ORDER BY u.id desc";
var dt = mySql.ExecuteDataTable(sql);
mySql.Close();
@@ -370,6 +408,7 @@ namespace KJD_Web.BLL.WXXD
sa_level = row.Table.Columns.Contains("sa_level") ? row["sa_level"].ParseToInt() : 0,
authority = row.Table.Columns.Contains("authority") ? row["authority"].ParseToString() : "",
points = row.Table.Columns.Contains("points") ? row["points"].ParseToInt() : 0,
shop_points_per_month = row.Table.Columns.Contains("shop_points_per_month") ? row["shop_points_per_month"].ParseToInt() : 30,
};
var main_authority = row.Table.Columns.Contains("main_authority") ? row["main_authority"].ParseToString() : "";
// 子账号积分用户权限跟随
@@ -416,8 +455,10 @@ namespace KJD_Web.BLL.WXXD
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
var shop_points_per_month = RegexUtils.GetStringQuery(ref inputData, "shop_points_per_month")?.Replace("'", "\\'");
if (shop_points_per_month.ParseToInt() <= 30) // 充值用户月积分消耗点数,最小30
shop_points_per_month = "30";
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
@@ -430,9 +471,10 @@ namespace KJD_Web.BLL.WXXD
return "{\"code\":500,\"msg\":\"用户名已存在\"}";
}
sql = "insert into wxxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,authority,add_time,mdy_time) " +
sql = "insert into wxxd.user (nick_name,user_name,mobile,password,card_id,group_id,company_name,notes,sa_level,authority," +
"shop_points_per_month,add_time,mdy_time) " +
"values ('" + nick_name + "','" + user_name + "','" + mobile + "','" + password + "','" + card_id + "','" +
group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" + authority + "','" +
group_id + "','" + company_name + "','" + notes + "'," + sa_level + ",'" + authority + "'," + shop_points_per_month + ",'" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" +
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "');";
var rst = mySql.ExecuteNonQuery(sql);
@@ -463,8 +505,7 @@ namespace KJD_Web.BLL.WXXD
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
var sa_level = RegexUtils.GetStringQuery(ref inputData, "sa_level")?.Replace("'", "\\'");
var authority = RegexUtils.GetStringQuery(ref inputData, "authority")?.Replace("'", "\\'");
int r2 = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "r2"), out r2);
var shop_points_per_month = RegexUtils.GetStringQuery(ref inputData, "shop_points_per_month")?.Replace("'", "\\'");
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
MysqlUtils mySql = new MysqlUtils(conn);
@@ -492,6 +533,8 @@ namespace KJD_Web.BLL.WXXD
sql += " sa_level=" + sa_level + ",";
if (authority != null)
sql += " authority='" + authority + "',";
if (shop_points_per_month != null)
sql += " shop_points_per_month=" + shop_points_per_month + ",";
sql = sql.TrimEnd(',');
sql += " where id=" + id + "";
@@ -614,6 +657,7 @@ namespace KJD_Web.BLL.WXXD
string sql;
int userPoints = 0;
int newUserPoints = 0;
int shopPointsPerMonth = 30;
#region 计算是否余额不足
sql = "SELECT points FROM `wxxd`.`user` WHERE user_name='" + user_name + "'";
@@ -627,11 +671,21 @@ namespace KJD_Web.BLL.WXXD
}
if (option_type == "续费")
{
if (delta_points <= 0 || delta_points % 30 > 0)
sql = "SELECT shop_points_per_month FROM `wxxd`.`user` WHERE user_name='" + user_name + "'";
shopPointsPerMonth = mySql.ExecuteFirstInt(sql); // 店铺续费一个月的点数,默认30,可以设置为其他值
if (!string.IsNullOrEmpty(mySql.Message))
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"续费点数必须是30的整倍数\"}";
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
}
shopPointsPerMonth = Math.Max(30, shopPointsPerMonth);
if (delta_points <= 0 || delta_points % shopPointsPerMonth > 0)
{
mySql.RollBack();
mySql.Close();
return "{\"code\":501,\"msg\":\"续费点数必须是" + shopPointsPerMonth + "的整倍数\"}";
}
else if (userPoints < delta_points)
{
@@ -709,7 +763,7 @@ namespace KJD_Web.BLL.WXXD
if (expireTime == 0)
{
newExpireTime = TimeUtils.DateTimeToTimestampSeconds(DateTime.Now.AddMonths(delta_points.ParseToInt() / 30));
newExpireTime = TimeUtils.DateTimeToTimestampSeconds(DateTime.Now.AddMonths(delta_points.ParseToInt() / shopPointsPerMonth));
sql = " INSERT INTO `wxxd`.`user_points_shop_expire` (shop_id,expire_time‌)" +
" VALUES ('" + shop_id + "'," + newExpireTime + ");";
}
@@ -717,9 +771,9 @@ namespace KJD_Web.BLL.WXXD
{
DateTime expireDateTime = TimeUtils.StampToDateTime(expireTime);
if (expireDateTime < DateTime.Now)
expireDateTime = DateTime.Now.AddMonths(delta_points.ParseToInt() / 30);
expireDateTime = DateTime.Now.AddMonths(delta_points.ParseToInt() / shopPointsPerMonth);
else
expireDateTime = expireDateTime.AddMonths(delta_points.ParseToInt() / 30);
expireDateTime = expireDateTime.AddMonths(delta_points.ParseToInt() / shopPointsPerMonth);
newExpireTime = TimeUtils.DateTimeToTimestampSeconds(expireDateTime);
sql = "UPDATE `wxxd`.`user_points_shop_expire` set expire_time‌=" + newExpireTime + " WHERE shop_id='" + shop_id + "' AND expire_time‌=" + expireTime;
@@ -70,5 +70,9 @@ namespace KJD_Web.Model
/// 用户积分点数
/// </summary>
public int points { get; set; }
/// <summary>
/// 单店铺续费1个月消耗的点数
/// </summary>
public int shop_points_per_month { get; set; }
}
}