day day up

This commit is contained in:
谢小军
2020-01-08 20:21:30 +08:00
parent 0a32dfe0e3
commit 204164e8b9
9 changed files with 90 additions and 20 deletions

View File

@@ -147,6 +147,7 @@ func (obj *_ExampleMgr) GetByOptions(opts ...Option) (results []*Example, err er
}
err = obj.DB.Table(obj.GetTableName()).Where(options.query).Find(&results).Error
if err == nil && obj.isRelated {
for i := 0; i < len(results); i++ {
var userList []User
@@ -162,9 +163,7 @@ func (obj *_ExampleMgr) GetByOptions(opts ...Option) (results []*Example, err er
// WithID id获取
func (obj *_ExampleMgr) WithID(id int64) Option {
return optionFunc(func(o *options) {
o.query["id"] = id
})
return optionFunc(func(o *options) { o.query["id"] = id })
}
func (obj *_ExampleMgr) WithUserID(id int64) Option {