createDate

This commit is contained in:
jiangyong27 2023-04-06 13:57:39 +08:00
parent dd327dc690
commit 3e2b24108e
1 changed files with 2 additions and 0 deletions

View File

@ -27,12 +27,14 @@ type Order struct {
CinemaName string CinemaName string
MovieName string MovieName string
Address string Address string
CreateDate string
CreateTime int64 CreateTime int64
UpdateTime int64 UpdateTime int64
} }
func AddOrder(o *Order) (int64, error) { func AddOrder(o *Order) (int64, error) {
o.CreateTime = time.Now().Unix() o.CreateTime = time.Now().Unix()
o.CreateDate = time.Now().Format("2006-01-02")
res := db.Table(tableNameOrder).Create(o) res := db.Table(tableNameOrder).Create(o)
return o.Id, res.Error return o.Id, res.Error
} }