diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 490c578..aac6aa9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,13 +4,9 @@
-
-
-
-
-
+
-
+
@@ -157,7 +153,6 @@
-
@@ -182,7 +177,8 @@
-
+
+
true
diff --git a/pkg/internal/services/sign.go b/pkg/internal/services/sign.go
index 9b3d824..8db8ac9 100644
--- a/pkg/internal/services/sign.go
+++ b/pkg/internal/services/sign.go
@@ -7,11 +7,14 @@ import (
"git.solsynth.dev/hydrogen/passport/pkg/internal/models"
"gorm.io/gorm"
"math/rand"
+ "time"
)
func CheckDailyCanSign(user models.Account) error {
+ probe := time.Now().Format("YYYY-MM-DD")
+
var record models.SignRecord
- if err := database.C.Where("account_id = ? AND created_at::date = ?", user.ID).First(&record).Error; err != nil {
+ if err := database.C.Where("account_id = ? AND created_at::date = ?", user.ID, probe).First(&record).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil
}