From 3c033759200ad7c02dd59521b1aebbbdc35b98fa Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期六, 08 二月 2025 16:18:50 +0800
Subject: [PATCH] 长场景人员分析模型

---
 service/task_results.go |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/service/task_results.go b/service/task_results.go
index bdeef8f..2c72759 100644
--- a/service/task_results.go
+++ b/service/task_results.go
@@ -1,7 +1,17 @@
 package service
 
-import "model-engine/db"
+import (
+	"model-engine/db"
+	"model-engine/pkg/logger"
+)
 
 func SaveTaskResults(results []*db.ModelTaskResults) error {
-	return db.NewModelTaskResultsSearch().BatchCreate(results)
+	for _, v := range results {
+		err := db.NewModelTaskResultsSearch().SetTaskId(v.ModelTaskID).SetPicDate(v.PicDate).SetFirstPersonId(v.FirstPersonID).FirstOrCreate(v)
+		if err != nil {
+			logger.Errorf("save task result err:%v", err)
+			return err
+		}
+	}
+	return nil
 }

--
Gitblit v1.8.0