bxx 控制器 商品增加 安全条件搜索和返回
This commit is contained in:
1 parent
0e38a1e31f
commit
5ddad5bceb
3 files changed
+25
-3
No files matched your search
@@ -673,6 +673,8 @@ namespace KJD_Web.BLL.BXX
|
||||
var max_sale_count_num = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "max_sale_count_num"))?.Replace("'", "\\'");
|
||||
var min_sale_count_num = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "min_sale_count_num"))?.Replace("'", "\\'");
|
||||
var is_del = RegexUtils.GetStringQuery(ref inputData, "is_del").ParseToInt();
|
||||
//安全状态:0 全部(默认),1 安全,2 违规,3 未检测。
|
||||
var safeStatus = RegexUtils.GetStringQuery(ref inputData, "safe_status").ParseToInt(0);
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
@@ -904,6 +906,10 @@ namespace KJD_Web.BLL.BXX
|
||||
{
|
||||
where += " and p.sale_count_num>=" + min_sale_count_num;
|
||||
}
|
||||
if (safeStatus > 0)
|
||||
{
|
||||
where += (" and p.is_safe " + (safeStatus == 1 ? "=1" : safeStatus == 2 ? "=0" : " is NULL"));
|
||||
}
|
||||
sql += where;
|
||||
|
||||
var count = 0;
|
||||
@@ -958,7 +964,7 @@ namespace KJD_Web.BLL.BXX
|
||||
sql = "SELECT p.id,p.from_shop_id,p.spu_id,p.skc_id,p.main_cat_id,p.main_cat_name,p.cat_id,p.cat_name,p.price_text,p.ext_code,p.product_name," +
|
||||
" p.main_img,p.notes,p.add_time,p.mdy_time,p.fission_words,p.head_words,p.end_words,p.group," +
|
||||
" p.product_get_type,p.wx_safe_status,p.sale_count_num,p.sale_count,p.sale_count_text,p.special_prod_type,p.from_shop_name,p.wx_cat_1,p.wx_cat_2,p.wx_cat_3," +
|
||||
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation,p.view_uv,p.add_user_name,p.is_del" +
|
||||
" p.wx_cat_leaf,p.send_to_out_server,p.secret_spu_id,p.real_coid,p.real_spu_id,p.is_relation,p.view_uv,p.add_user_name,p.is_del,p.is_safe" +
|
||||
" FROM " + tableName + " p" +
|
||||
" WHERE p.is_del=" + is_del;
|
||||
|
||||
@@ -1020,6 +1026,7 @@ namespace KJD_Web.BLL.BXX
|
||||
is_relation = row["is_relation"].ParseToInt(),
|
||||
add_user_name = row["add_user_name"].ParseToString(),
|
||||
is_del = row["is_del"].ParseToNullableInt(),
|
||||
is_safe = row["is_safe"].ParseToNullableBool(),
|
||||
};
|
||||
if (isDetail)
|
||||
{
|
||||
@@ -4375,7 +4382,7 @@ namespace KJD_Web.BLL.BXX
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = "UPDATE bxx.product set is_safe=1 WHERE id="+id;
|
||||
sql = "UPDATE bxx.product set is_safe=1 WHERE id=" + id;
|
||||
|
||||
count = mySql.ExecuteAffectedRows(sql);
|
||||
|
||||
|
||||
@@ -108,7 +108,8 @@ namespace KJD_Web.Model
|
||||
public int is_relation { get; set; }
|
||||
public string add_user_name { get; set; }
|
||||
public int? is_del { get; set; }
|
||||
}
|
||||
public bool? is_safe { get; set; }
|
||||
}
|
||||
|
||||
public class KJDDBProduct : DBProductResultParam
|
||||
{
|
||||
|
||||
@@ -303,6 +303,20 @@ namespace NaiBa.Util.Extension
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public static bool? ParseToNullableBool(this object str)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 1. 快速判断:如果为 null 或 DBNull,直接返回
|
||||
if (str == null || str == DBNull.Value)
|
||||
return null;
|
||||
return bool.Parse(str.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 转换为float
|
||||
|
||||
Reference in new issue
Block a user