From 22e07637ceff68d23471fb06d94ce493c5dbd76c Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Fri, 13 Dec 2024 18:05:16 -0800 Subject: [PATCH] Convert. --- models/event/event.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/models/event/event.go b/models/event/event.go index 9dc1ba7b6..59c6279d9 100644 --- a/models/event/event.go +++ b/models/event/event.go @@ -161,6 +161,13 @@ func (e *Event) PrimaryKeys() []string { func (e *Event) PrimaryKeyValue() string { var key string for _, pk := range e.PrimaryKeys() { + // Convert float64 to int64 + value := e.PrimaryKeyMap[pk] + switch castedValue := value.(type) { + case float64: + e.PrimaryKeyMap[pk] = int64(castedValue) + } + key += fmt.Sprintf("%s=%v", pk, e.PrimaryKeyMap[pk]) }