From 81538d5e17c81119f19551f633e67c85fad9a3ba Mon Sep 17 00:00:00 2001 From: jack li Date: Sat, 17 Aug 2024 14:10:34 +0800 Subject: [PATCH] feat(field): week func support set mode --- field/time.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/field/time.go b/field/time.go index e5d70458..a2b3863e 100644 --- a/field/time.go +++ b/field/time.go @@ -120,8 +120,8 @@ func (field Time) Month() Int { } // Week equal to WEEK(self) -func (field Time) Week() Int { - return Int{expr{e: clause.Expr{SQL: "WEEK(?)", Vars: []interface{}{field.RawExpr()}}}} +func (field Time) Week(mode int) Int { + return Int{expr{e: clause.Expr{SQL: fmt.Sprintf("WEEK(?, %d)", mode), Vars: []interface{}{field.RawExpr()}}}} } // Day equal to DAY(self)