加入微信客服相关功能 40%
This commit is contained in:
1 parent
f71cb1bba8
commit
c05c7e4f23
93 files changed
+2824
-356
No files matched your search
@@ -838,6 +838,7 @@ namespace KJD_Web.BLL
|
||||
var search_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "search_sub_sa_name")?.Replace("'", "\\'");
|
||||
var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'");
|
||||
var operate_sub_sa_name = RegexUtils.GetStringQuery(ref inputData, "operate_sub_sa_name")?.Replace("'", "\\'");
|
||||
var search_year = RegexUtils.GetStringQuery(ref inputData, "search_year")?.Replace("'", "\\'").ParseToInt();
|
||||
|
||||
var search_end_time = RegexUtils.GetStringJson(ref inputData, "search_end_time")?.ParseToDateTimeNullable();
|
||||
if (search_end_time == null || search_end_time.Value > DateTime.Now.Date.AddDays(1)) search_end_time = DateTime.Now.Date.AddDays(1);
|
||||
@@ -854,26 +855,41 @@ namespace KJD_Web.BLL
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "select count(s.id) from (";
|
||||
|
||||
for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
|
||||
string sql = "";
|
||||
if (search_year != null)
|
||||
{
|
||||
string dbName = "kjd";
|
||||
if (year >= 2026)
|
||||
if (search_year >= 2026)
|
||||
dbName = "kjd_yearly";
|
||||
string tableName = dbName + ".third_product_select";
|
||||
|
||||
if (year >= 2026)
|
||||
tableName += "_" + year;
|
||||
if (year > search_start_time.Value.Year)
|
||||
sql += " UNION ALL";
|
||||
sql += " SELECT * FROM " + tableName;
|
||||
if (search_year >= 2026)
|
||||
tableName += "_" + search_year;
|
||||
sql += " SELECT count(s.id) FROM " + tableName + " s " +
|
||||
//"LEFT JOIN kjd.third_product p on s.out_product_id=p.id " +
|
||||
//"LEFT JOIN kjd.user u on s.operate_sub_sa_name=u.user_name " +
|
||||
"WHERE 1=1";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "select count(s.id) from (";
|
||||
for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
|
||||
{
|
||||
string dbName = "kjd";
|
||||
if (year >= 2026)
|
||||
dbName = "kjd_yearly";
|
||||
string tableName = dbName + ".third_product_select";
|
||||
|
||||
sql += ") s " +
|
||||
"LEFT JOIN kjd.third_product p on s.out_product_id=p.id " +
|
||||
"LEFT JOIN kjd.user u on s.operate_sub_sa_name=u.user_name " +
|
||||
"WHERE s.add_time BETWEEN '" + search_start_time.Value.ToString("yyyy-MM-dd") + "' AND '" + search_end_time.Value.ToString("yyyy-MM-dd") + "' ";
|
||||
if (year >= 2026)
|
||||
tableName += "_" + year;
|
||||
if (year > search_start_time.Value.Year)
|
||||
sql += " UNION ALL";
|
||||
sql += " SELECT * FROM " + tableName;
|
||||
}
|
||||
sql += ") s " +
|
||||
"LEFT JOIN kjd.third_product p on s.out_product_id=p.id " +
|
||||
"LEFT JOIN kjd.user u on s.operate_sub_sa_name=u.user_name " +
|
||||
"WHERE s.add_time BETWEEN '" + search_start_time.Value.ToString("yyyy-MM-dd") + "' AND '" + search_end_time.Value.ToString("yyyy-MM-dd") + "' ";
|
||||
}
|
||||
|
||||
string where = "";
|
||||
if (!isAdmin)
|
||||
@@ -944,35 +960,83 @@ namespace KJD_Web.BLL
|
||||
//if (isDetail)
|
||||
//sql = "select * from kjd.third_product_select where 1=1";
|
||||
//else
|
||||
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," +
|
||||
"u.nick_name as operate_sub_sa_nick " +
|
||||
"FROM (";
|
||||
|
||||
for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
|
||||
if (search_year != null)
|
||||
{
|
||||
string dbName = "kjd";
|
||||
if (year >= 2026)
|
||||
if (search_year >= 2026)
|
||||
dbName = "kjd_yearly";
|
||||
string tableName = dbName + ".third_product_select";
|
||||
if (search_year >= 2026)
|
||||
tableName += "_" + search_year;
|
||||
|
||||
if (year >= 2026)
|
||||
tableName += "_" + year;
|
||||
if (year > search_start_time.Value.Year)
|
||||
sql += " UNION ALL";
|
||||
sql += " SELECT * FROM " + tableName;
|
||||
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," +
|
||||
"u.nick_name as operate_sub_sa_nick " +
|
||||
"FROM " + tableName + " s LEFT JOIN kjd.third_product p ON s.out_product_id=p.id " +
|
||||
"LEFT JOIN kjd.user u ON u.user_name=s.operate_sub_sa_name " +
|
||||
"WHERE 1=1";
|
||||
sql += where; // where子句
|
||||
sql += " order by s.add_time desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
|
||||
|
||||
sql = "SELECT s1.id,s1.out_product_id,s1.shop_id,s1.shop_account,s1.user_name," +
|
||||
"s1.sub_user_name,s1.notes,s1.user_notes,s1.status,s1.draft_id,s1.add_times,s1.add_time,s1.mdy_time," +
|
||||
"s1.fission_product_name,s1.operate_sub_sa_name,s1.add_sub_sa_time," +
|
||||
"s2.spu_id,s2.skc_id,s2.cat_id,s2.cat_name,s2.change_cat_id,s2.change_cat_name,s2.ext_code,s2.product_name,s2.main_img ";
|
||||
if (operate_sub_sa_name != null || 1 == 2)
|
||||
sql += ",s2.operate_sub_sa_nick";
|
||||
sql += " FROM " + tableName + " s1";
|
||||
// 子查询
|
||||
sql += " JOIN (SELECT s.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 ";
|
||||
if (operate_sub_sa_name != null || 1 == 2)
|
||||
sql += ",u.nick_name as operate_sub_sa_nick ";
|
||||
sql += " FROM " + tableName + " s LEFT JOIN kjd.third_product p ON s.out_product_id=p.id ";
|
||||
if (operate_sub_sa_name != null || 1 == 2)
|
||||
sql += "LEFT JOIN kjd.user u ON u.user_name=s.operate_sub_sa_name ";
|
||||
sql += "WHERE 1=1";
|
||||
sql += where; // where子句
|
||||
sql += " order by s.add_time desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
sql += ") as s2 ON s1.id = s2.id";
|
||||
}
|
||||
else
|
||||
{
|
||||
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," +
|
||||
"u.nick_name as operate_sub_sa_nick " +
|
||||
"FROM (";
|
||||
|
||||
sql += ") s LEFT JOIN kjd.third_product p ON s.out_product_id=p.id " +
|
||||
"LEFT JOIN kjd.user u ON u.user_name=s.operate_sub_sa_name " +
|
||||
"WHERE 1=1";
|
||||
for (int year = search_start_time.Value.Year; year <= search_end_time.Value.Year; year++)
|
||||
{
|
||||
string dbName = "kjd";
|
||||
if (year >= 2026)
|
||||
dbName = "kjd_yearly";
|
||||
string tableName = dbName + ".third_product_select";
|
||||
|
||||
sql += where; // where子句
|
||||
if (year >= 2026)
|
||||
tableName += "_" + year;
|
||||
if (year > search_start_time.Value.Year)
|
||||
sql += " UNION ALL";
|
||||
sql += " SELECT * FROM " + tableName;
|
||||
}
|
||||
|
||||
sql += " order by s.add_time desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
sql += ") s LEFT JOIN kjd.third_product p ON s.out_product_id=p.id " +
|
||||
"LEFT JOIN kjd.user u ON u.user_name=s.operate_sub_sa_name " +
|
||||
"WHERE s.add_time BETWEEN '" + search_start_time.Value.ToString("yyyy-MM-dd") + "' AND '" + search_end_time.Value.ToString("yyyy-MM-dd") + "' ";
|
||||
|
||||
|
||||
sql += where; // where子句
|
||||
|
||||
sql += " order by s.add_time desc";
|
||||
sql += " limit " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
}
|
||||
dt = mySql.ExecuteDataTable(sql, paramLst.ToArray());
|
||||
}
|
||||
|
||||
@@ -1008,12 +1072,15 @@ namespace KJD_Web.BLL
|
||||
skc_id = row["skc_id"].ToString(),
|
||||
spu_id = row["spu_id"].ToString(),
|
||||
operate_sub_sa_name = row["operate_sub_sa_name"].ToString(),
|
||||
operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString(),
|
||||
fission_product_name = row["fission_product_name"].ToString(),
|
||||
user_notes = row["user_notes"].ToString(),
|
||||
//product_json = row["product_json"].ToString(),
|
||||
//size_json = row["size_json"].ToString(),
|
||||
};
|
||||
if (operate_sub_sa_name != null || 1 == 2)
|
||||
{
|
||||
prodSelect.operate_sub_sa_nick = row["operate_sub_sa_nick"].ToString();
|
||||
}
|
||||
prodSelect.add_sub_sa_time = row["add_sub_sa_time"] as DateTime?;
|
||||
productLst.Add(prodSelect);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
|
||||
Reference in new issue
Block a user