1.界面优化调整 2.618取消活动 3.清理无流量新 4.用户商品库1688及拼多多外部商品入库逻辑优化 5.带百分号的属性微信上货优化 6.数据库产品在不同用户间迁移 7.删除店铺功能开放给充值用户防止店铺导入错误无法删除
This commit is contained in:
1 parent
2759ff0f6d
commit
0a9980335f
59 files changed
+3078
-652
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user