From 42bb3f3e4cb84d9a53ab6d6408f3b480eec776a0 Mon Sep 17 00:00:00 2001 From: skx <610262374@qq.com> Date: Sat, 2 May 2020 09:45:03 +0800 Subject: [PATCH] PgSql BUG --- .../PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs index 0d619f8c6..82623421b 100644 --- a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLExpressionContext.cs @@ -178,14 +178,14 @@ namespace SqlSugar var parameter = model.Args[0]; var parameter2 = model.Args[1]; var parameter3 = model.Args[2]; - return string.Format(" (DATE_ADD({1} , INTERVAL {2} {0})) ", parameter3.MemberValue, parameter.MemberName, parameter2.MemberName); + return string.Format(" ({1} + ({2}||'{0}')::INTERVAL) ", parameter3.MemberValue, parameter.MemberName, parameter2.MemberName); } public override string DateAddDay(MethodCallExpressionModel model) { var parameter = model.Args[0]; var parameter2 = model.Args[1]; - return string.Format(" (DATE_ADD({1} INTERVAL {0} day)) ", parameter.MemberName, parameter2.MemberName); + return string.Format(" ({0} + ({1}||'day')::INTERVAL) ", parameter.MemberName, parameter2.MemberName); } public override string ToInt32(MethodCallExpressionModel model)