liujiandao
2024-04-22 8cb1da78fd4d237b278ed4d512c6c4f04b663cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package models
 
import (
    "gorm.io/gorm"
)
 
type WmsModel struct {
    gorm.Model `json:"-"`
    CreateTime string `json:"createTime"  gorm:"-"`
    UpdateTime string `json:"updateTime"  gorm:"-"`
}
 
func (slf *WmsModel) AfterFind(tx *gorm.DB) (err error) {
    slf.CreateTime = slf.CreatedAt.Format("2006-01-02 15:04")
    slf.UpdateTime = slf.UpdatedAt.Format("2006-01-02 15:04")
    return nil
}