1.support dynamic registration model

2.support aggregete func
This commit is contained in:
AllenX2018
2021-01-04 16:29:03 +08:00
parent c1b7fa5381
commit 30dbf8fc3a
6 changed files with 124 additions and 26 deletions

View File

@@ -79,6 +79,7 @@ type querySet struct {
orm *ormBase
ctx context.Context
forContext bool
aggregate string
}
var _ QuerySeter = new(querySet)
@@ -323,3 +324,9 @@ func newQuerySet(orm *ormBase, mi *modelInfo) QuerySeter {
o.orm = orm
return o
}
// aggregate func
func (o querySet) Aggregate(s string) QuerySeter {
o.aggregate = s
return &o
}