diff --git a/lectures/lecture4/code/beeblog/models/models.go b/lectures/lecture4/code/beeblog/models/models.go index 2559ecf..c896dab 100644 --- a/lectures/lecture4/code/beeblog/models/models.go +++ b/lectures/lecture4/code/beeblog/models/models.go @@ -63,7 +63,11 @@ func RegisterDB() { func AddCategory(name string) error { o := orm.NewOrm() - cate := &Category{Title: name} + cate := &Category{ + Title: name, + Created: time.Now(), + TopicTime: time.Now(), + } // 查询数据 qs := o.QueryTable("category")