mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-15 20:49:31 +08:00
Optimized code
This commit is contained in:
parent
131108e282
commit
ec65f46576
@ -886,10 +886,18 @@ namespace SqlSugar
|
||||
{
|
||||
return $"strftime('%Y-%m-%d', {value})";
|
||||
}
|
||||
else if (IsSqlite() && formatString.Contains("%"))
|
||||
{
|
||||
return $"strftime('{formatString}', {value})";
|
||||
}
|
||||
else if (IsMySql() && formatString == "yyyy-MM-dd")
|
||||
{
|
||||
return $"DATE_FORMAT({value}, '%Y-%m-%d')";
|
||||
}
|
||||
else if (IsMySql() && formatString.Contains("%"))
|
||||
{
|
||||
return $"DATE_FORMAT({value}, '{formatString}')";
|
||||
}
|
||||
else if (formatString == "yyyy-MM-dd" && IsSqlServer())
|
||||
{
|
||||
return $"CONVERT(varchar(100),convert(datetime,{value}), 23)";
|
||||
|
Loading…
Reference in New Issue
Block a user