🐛 Fix date formatting issue on daily signing

This commit is contained in:
2024-09-02 22:48:06 +08:00
parent a23c51f483
commit 3ce5ef6617
2 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import (
)
func CheckDailyCanSign(user models.Account) error {
probe := time.Now().Format("YYYY-MM-DD")
probe := time.Now().Format("2006-01-02")
var record models.SignRecord
if err := database.C.Where("account_id = ? AND created_at::date = ?", user.ID, probe).First(&record).Error; err != nil {
@ -24,7 +24,7 @@ func CheckDailyCanSign(user models.Account) error {
}
func GetTodayDailySign(user models.Account) (models.SignRecord, error) {
probe := time.Now().Format("YYYY-MM-DD")
probe := time.Now().Format("2006-01-02")
var record models.SignRecord
if err := database.C.Where("account_id = ? AND created_at::date = ?", user.ID, probe).First(&record).Error; err != nil {