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/usermngmt/internal"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
)
|
||||
|
||||
// UserCreateOptions ...
|
||||
|
@ -44,6 +45,7 @@ type UserAllQuery struct {
|
|||
Status string
|
||||
Sort interface{}
|
||||
Other map[string]interface{} // query fields in other object
|
||||
Cond bson.M
|
||||
}
|
||||
|
||||
// UserCountQuery ...
|
||||
|
|
|
@ -157,6 +157,10 @@ func All(queryParams model.UserAllQuery) (r model.UserAll) {
|
|||
wg sync.WaitGroup
|
||||
cond = bson.M{}
|
||||
)
|
||||
if queryParams.Cond != nil {
|
||||
cond = queryParams.Cond
|
||||
}
|
||||
|
||||
query := model.CommonQuery{
|
||||
Page: queryParams.Page,
|
||||
Limit: queryParams.Limit,
|
||||
|
|
Loading…
Reference in New Issue