diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs index cce1dc9e6..f0a917f32 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs @@ -317,13 +317,18 @@ namespace SqlSugar break; case ResolveExpressType.FieldSingle: case ResolveExpressType.FieldMultiple: - if (express.Method.Name == "ToString" && express.Object!=null&&express.Object?.Type == UtilConstants.DateType) + if (express.Method.Name == "ToString" && express.Object != null && express.Object?.Type == UtilConstants.DateType) { - var format = (args[0] as ConstantExpression).Value+""; + var format = (args[0] as ConstantExpression).Value + ""; var value = GetNewExpressionValue(express.Object); var dateString = GeDateFormat(format, value); base.AppendValue(parameter, isLeft, dateString); } + else + { + var value = GetNewExpressionValue(express,this.Context.IsJoin?ResolveExpressType.WhereMultiple: ResolveExpressType.WhereSingle); + base.AppendValue(parameter, isLeft, value); + } break; default: break;