update UserAllQuery
This commit is contained in:
parent
81df358020
commit
d85b4c9760
|
@ -5,6 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/Selly-Modules/logger"
|
"github.com/Selly-Modules/logger"
|
||||||
"github.com/Selly-Modules/usermngmt/internal"
|
"github.com/Selly-Modules/usermngmt/internal"
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UserCreateOptions ...
|
// UserCreateOptions ...
|
||||||
|
@ -44,6 +45,7 @@ type UserAllQuery struct {
|
||||||
Status string
|
Status string
|
||||||
Sort interface{}
|
Sort interface{}
|
||||||
Other map[string]interface{} // query fields in other object
|
Other map[string]interface{} // query fields in other object
|
||||||
|
Cond bson.M
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserCountQuery ...
|
// UserCountQuery ...
|
||||||
|
|
|
@ -157,6 +157,10 @@ func All(queryParams model.UserAllQuery) (r model.UserAll) {
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
cond = bson.M{}
|
cond = bson.M{}
|
||||||
)
|
)
|
||||||
|
if queryParams.Cond != nil {
|
||||||
|
cond = queryParams.Cond
|
||||||
|
}
|
||||||
|
|
||||||
query := model.CommonQuery{
|
query := model.CommonQuery{
|
||||||
Page: queryParams.Page,
|
Page: queryParams.Page,
|
||||||
Limit: queryParams.Limit,
|
Limit: queryParams.Limit,
|
||||||
|
|
Loading…
Reference in New Issue