Browse Source

Update SqlFunc.WeekOfYear

pull/40/head
sunkaixuan 1 year ago
parent
commit
e3f2e5e515
  1. 2
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs
  2. 2
      Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs

2
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs

@ -972,7 +972,7 @@ namespace SqlSugar
public virtual string WeekOfYear(MethodCallExpressionModel mode)
{
var parameterNameA = mode.Args[0].MemberName;
return $" DATE_PART('week', {parameterNameA}) ";
return $" DATE_PART('week', {parameterNameA})+1 ";
}
}
}

2
Src/Asp.NetCore2/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs

@ -20,7 +20,7 @@ namespace SqlSugar
public override string WeekOfYear(MethodCallExpressionModel mode)
{
var parameterNameA = mode.Args[0].MemberName;
return $"STRFTIME('%W', {parameterNameA}) ";
return $"STRFTIME('%W', {parameterNameA})+1 ";
}
public override string Equals(MethodCallExpressionModel model)
{

Loading…
Cancel
Save