Browse Source

ccf时间格式修改

xyxie 1 month ago
parent
commit
cbc9136df0
1 changed files with 14 additions and 1 deletions
  1. 14 1
      models/data_manage/base_from_ccf.go

+ 14 - 1
models/data_manage/base_from_ccf.go

@@ -4,9 +4,10 @@ import (
 	"database/sql"
 	"eta/eta_api/global"
 	"eta/eta_api/utils"
+	"time"
+
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"gorm.io/gorm"
-	"time"
 )
 
 type BaseFromCCFIndex struct {
@@ -38,6 +39,18 @@ type BaseFromCCFIndexList struct {
 	DataList           []*BaseFromCCFData `gorm:"-"`
 	Paging             *paging.PagingItem `description:"分页数据" gorm:"-"`
 }
+func (b *BaseFromCCFIndexList) TableName() string {
+	return "base_from_ccf_index"
+}
+
+func (b *BaseFromCCFIndexList) AfterFind(tx *gorm.DB) (err error) {
+	if utils.NeedDateOrTimeFormat(utils.DbDriverName) {
+		b.ModifyTime = utils.GormDateStrToDateTimeStr(b.ModifyTime)
+		b.CreateTime = utils.GormDateStrToDateTimeStr(b.CreateTime)
+		b.EndDate = utils.GormDateStrToDateStr(b.EndDate)
+	}
+	return
+}
 
 type CCFSingleDataResp struct {
 	BaseFromCcfIndexId int