Browse Source

上传至社区

xyxie 1 month ago
parent
commit
d5fbadd3fa
1 changed files with 6 additions and 0 deletions
  1. 6 0
      models/data_manage/edb_data_base.go

+ 6 - 0
models/data_manage/edb_data_base.go

@@ -9,6 +9,7 @@ import (
 	"time"
 
 	"go.mongodb.org/mongo-driver/bson"
+	"gorm.io/gorm"
 )
 
 // GetEdbDataTableName 指标数据->存储表
@@ -234,6 +235,11 @@ type EdbDataBase struct {
 	DataTimestamp int64
 }
 
+func (e *EdbDataBase) AfterFind(tx *gorm.DB) (err error) {
+	e.DataTime = utils.GormDateStrToDateStr(e.DataTime)
+	return
+}
+
 func GetEdbDataAllByEdbCode(edbCode string, source, subSource, limit int) (items []*EdbInfoSearchData, err error) {
 	// 自有数据需要额外处理(从mongo获取)
 	if source == utils.DATA_SOURCE_BUSINESS && utils.UseMongo {