From bb71174d59146ee7ba620ed968988efa68724486 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 27 Feb 2023 17:05:22 +0800 Subject: [PATCH] Update mysql min date --- .../SqlSugar/Realization/MySql/MySqlProvider.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/MySql/MySqlProvider.cs b/Src/Asp.NetCore2/SqlSugar/Realization/MySql/MySqlProvider.cs index f49f3b842..bfe9594d9 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/MySql/MySqlProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/MySql/MySqlProvider.cs @@ -135,6 +135,14 @@ namespace SqlSugar sqlParameter.Value = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)sqlParameter.Value); sqlParameter.DbType = System.Data.DbType.DateTime; } + if (sqlParameter.Value is DateTime&&sqlParameter.Value.ObjToDate()==DateTime.MinValue) + { + var date = Convert.ToDateTime(sqlParameter.Value); + if (date == DateTime.MinValue) + { + sqlParameter.Value = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig); + } + } ++index; } return result;