From 16e06252079d36be7686a3d006c8b73565973c68 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 18 十二月 2023 21:04:08 +0800
Subject: [PATCH] 全文搜索支持时间查询
---
controllers/operation.go | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/controllers/operation.go b/controllers/operation.go
index f42fe69..e75abc4 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -733,7 +733,7 @@
func AddMoveHistory(operationList []*models.Operation, db *gorm.DB) error {
var histories []*models.MoveHistory
- operationMap := make(map[string]*models.Operation, len(operationList))
+ operationMap := make(map[int]*models.Operation, len(operationList))
for _, operation := range operationList {
for _, v := range operation.Details {
history := &models.MoveHistory{
@@ -754,13 +754,13 @@
}
histories = append(histories, history)
}
- operationMap[operation.Number] = operation
+ operationMap[operation.Id] = operation
}
if err := db.Model(&models.MoveHistory{}).Create(&histories).Error; err != nil {
return err
}
for _, history := range histories {
- service.AddNewHistoryReportRecord(history, operationMap[history.Number])
+ service.AddNewHistoryReportRecord(history, operationMap[history.OperationId])
}
return nil
}
--
Gitblit v1.8.0