Update 人大金仓[SqlServer]

This commit is contained in:
sunkaixuan 2024-08-13 11:02:48 +08:00
parent 8e171fec97
commit 499dec9569
2 changed files with 14 additions and 1 deletions

View File

@ -20,6 +20,10 @@ namespace SqlSugar
}
else if (IsOracle() || IsPg())
{
if (this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer)
{
return string.Format("FORMAT({0},'{1}','en-US')", value, formatString);
}
if (!(formatString?.Contains("24") == true))
{
formatString = formatString.Replace("HH", "hh24");

View File

@ -1,4 +1,4 @@
using System;
 using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -786,6 +786,10 @@ namespace SqlSugar
if (model.Args.Count > 1)
{
var dateString2 = this.Context.DbMehtods.GetDateString(model.Args.First().MemberName.ObjToString(), model.Args.Last().MemberValue.ObjToString());
if (IsSqlServerModel())
{
return string.Format("FORMAT({0},'{1}','en-US')", model.Args.First().MemberName.ObjToString(), model.Args.Last().MemberValue.ObjToString());
}
if (dateString2 != null) return dateString2;
return GeDateFormat(model.Args.Last().MemberValue.ObjToString(), model.Args.First().MemberName.ObjToString());
}
@ -999,6 +1003,11 @@ namespace SqlSugar
return null;
}
private bool IsSqlServerModel()
{
return this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
}
private string GetLike(string result, bool iLike)
{
if (iLike)