This commit is contained in:
2024-09-27 10:58:05 +08:00
parent 65f3511ecb
commit ba6dbcc2c7
5 changed files with 85 additions and 14 deletions
+1 -3
View File
@@ -16,19 +16,17 @@ func HandleQuestionQaExpire() {
maps := make(map[string]interface{})
maps["qa_status"] = 1
now := time.Now()
// 当前时间
now := time.Now()
endTime := now.Format("2006-01-02 15:04")
// 今天开始时间
year, month, day := now.Date()
location := now.Location()
startTime := time.Date(year, month, day, 00, 00, 00, 0, location).Format("2006-01-02 15:04")
questionQas, err := questionQaDao.GetQuestionQaListByQaExpireTime(maps, startTime, endTime)
if err == nil && len(questionQas) > 0 {
for _, qa := range questionQas {
// 检测状态
if qa.QaStatus == 2 {
continue