From fecadd24cd5c0e33d3392f0b38972579c6ea4a0b Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期一, 10 二月 2025 09:24:41 +0800 Subject: [PATCH] 测试 场景分析 bug --- models/locationAnalysis.go | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/models/locationAnalysis.go b/models/locationAnalysis.go index 347927f..1c72444 100644 --- a/models/locationAnalysis.go +++ b/models/locationAnalysis.go @@ -282,8 +282,8 @@ func queryEsLocation(esClient *elasticsearch.Client, locationModel *LocationModel, documentNumbers []string) ([]*LocationRecord, error) { var buf bytes.Buffer - nowTime := time.Now() - startTime := nowTime.Add(-time.Duration(locationModel.Duration) * 24 * time.Hour) + //nowTime := time.Now() + //startTime := nowTime.Add(-time.Duration(locationModel.Duration) * 24 * time.Hour) // 鏋勫缓杩囨护鏉′欢 var filters []map[string]interface{} @@ -343,19 +343,19 @@ // }, // }, //}) - for date := startTime; date.Before(nowTime); date = date.Add(24 * time.Hour) { - start := time.Date(date.Year(), date.Month(), date.Day(), locationModel.StartTime, 0, 0, 0, date.Location()) - end := time.Date(date.Year(), date.Month(), date.Day(), locationModel.EndTime, 0, 0, 0, date.Location()) - - filters = append(filters, map[string]interface{}{ - "range": map[string]interface{}{ - "picDate": map[string]interface{}{ - "gte": start.Format("2006-01-02 15:04:05"), - "lte": end.Format("2006-01-02 15:04:05"), - }, - }, - }) - } + //for date := startTime; date.Before(nowTime); date = date.Add(24 * time.Hour) { + // start := time.Date(date.Year(), date.Month(), date.Day(), locationModel.StartTime, 0, 0, 0, date.Location()) + // end := time.Date(date.Year(), date.Month(), date.Day(), locationModel.EndTime, 0, 0, 0, date.Location()) + // + // filters = append(filters, map[string]interface{}{ + // "range": map[string]interface{}{ + // "picDate": map[string]interface{}{ + // "gte": start.Format("2006-01-02 15:04:05"), + // "lte": end.Format("2006-01-02 15:04:05"), + // }, + // }, + // }) + //} //logger.Debugf("filters--------------------------------------- %s", filters) query := map[string]interface{}{ "query": map[string]interface{}{ -- Gitblit v1.8.0