bxx 控制器 商品增加 安全条件搜索和返回

This commit is contained in:
chfei committed 2026-11-09 10:44:24 +08:00
1 parent 0e38a1e31f
commit 5ddad5bceb
3 files changed
+27 -5

No files matched your search

@@ -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