From 45fcdf551e912e84042c22e90912367982392ea5 Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期六, 08 二月 2025 18:02:29 +0800
Subject: [PATCH] 测试 场景问题群

---
 models/locationAnalysis.go |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/models/locationAnalysis.go b/models/locationAnalysis.go
index 2a6ddcf..e4ff76a 100644
--- a/models/locationAnalysis.go
+++ b/models/locationAnalysis.go
@@ -133,29 +133,23 @@
 	var document_number_list []string
 	err := db.GetDB().Raw(`
 		SELECT
+		    p.id,
 			s.document_number,
--- 			s.community_id,
--- 			s.org_id,
--- 			p.person_name,
--- 			p.id_card,
-			s.last_appearance_time,
--- 			s.last_direction,
--- 			s.last_location 
+			s.last_appearance_time
 		FROM
 			snapshot_count_summary AS s
 			JOIN person AS p ON p.id = s.document_number
 		WHERE
 			p.id_card != "" 
-			AND (p.community_id IN ?
-			OR p.org_id IN ?)
-			AND p.status IN ?
+			AND (s.community_id IN ? OR s.org_id IN ?)
+			AND s.status IN ?
 		`, m.AreaIds, m.OrgIds, m.PersonIdentity).Scan(&baseFilter).Error
 	if err != nil {
 		logger.Warnf(err.Error())
 	}
 
 	if len(baseFilter) == 0 {
-		return fmt.Errorf("no results found that match the age condition %s - %s ", m.AreaIds, m.OrgIds)
+		return fmt.Errorf("no results found that match the age condition %s - %s - %s ", m.AreaIds, m.OrgIds, m.PersonIdentity)
 	}
 
 	logger.Debugf("task %s match age result %d", m.Task.Name, len(baseFilter))

--
Gitblit v1.8.0