Explorar el Código

调整获取聊天记录范围

boweniac hace 1 día
padre
commit
6d556cb61c
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      internal/service/wechat/analyze_contact_field.go

+ 4 - 2
internal/service/wechat/analyze_contact_field.go

@@ -148,8 +148,10 @@ func (l *AnalyzeContactField) Analyze(bot_wxid *string, contact_wxid *string) {
 	//yesterdayEnd := yesterdayStart.Add(24 * time.Hour)
 	loc, _ := time.LoadLocation("Asia/Shanghai")
 	now := time.Now().In(loc)
-	yesterdayEnd := now.Truncate(24 * time.Hour).Add(-16 * time.Hour)
-	yesterdayStart := yesterdayEnd.AddDate(0, 0, -1)
+	yesterdayEnd := now.Add(-8 * time.Hour)
+	yesterdayStart := now.Add(-32 * time.Hour)
+	//yesterdayEnd := now.Truncate(24 * time.Hour).Add(-16 * time.Hour)
+	//yesterdayStart := yesterdayEnd.AddDate(0, 0, -1)
 	predicates = append(predicates, usagedetail.CreatedAtGTE(yesterdayStart))
 	predicates = append(predicates, usagedetail.CreatedAtLT(yesterdayEnd))
 	if bot_wxid != nil && *bot_wxid != "" {