From 69d84a0efcb7b72cba5c5d9ebce0ee89542f09a6 Mon Sep 17 00:00:00 2001
From: jhc <9316338+wangyitao309@user.noreply.gitee.com>
Date: Thu, 18 May 2023 18:21:20 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pkg/model/approval.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/model/approval.go b/pkg/model/approval.go
index 68fc593..e453eb6 100644
--- a/pkg/model/approval.go
+++ b/pkg/model/approval.go
@@ -195,7 +195,7 @@ func ExistLeaveApplyApproval(in *approval.CreateRequest) bool {
 		Where("status in (?)", []uint64{StatusDoing, StatusOk})
 
 	if LeaveBalanceUsefulTime[in.Type] == OnceAYear {
-		subQuery1.Where("DATE_FORMAT(created_at,%Y) = ?", time.Now().Format("2006"))
+		subQuery1.Where(" STR_TO_DATE(created_at,%Y) = ?", time.Now().Format("2006"))
 	}
 
 	subQuery1.Select("id")