|
@@ -117,6 +117,28 @@ func GetPlanSuppliers(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
List: []map[string]interface{}{},
|
|
|
}
|
|
|
listOut := []map[string]interface{}{}
|
|
|
+ if len(query) == 0 {
|
|
|
+ option := &repo.PageSearchOptions{
|
|
|
+ CollectName: repo.CollectionSupplier,
|
|
|
+ Query: query,
|
|
|
+ Page: page,
|
|
|
+ Size: size,
|
|
|
+ Sort: bson.M{"createTime": -1},
|
|
|
+ }
|
|
|
+ return repo.RepoPageSearch(apictx.CreateRepoCtx(), option)
|
|
|
+ }
|
|
|
+
|
|
|
+ if cate, ok := query["category"]; ok {
|
|
|
+ delete(query, "category")
|
|
|
+ option := &repo.PageSearchOptions{
|
|
|
+ CollectName: repo.CollectionSupplier,
|
|
|
+ Query: repo.Map{"categorys": bson.M{"$in": []string{cate.(string)}}},
|
|
|
+ Page: page,
|
|
|
+ Size: size,
|
|
|
+ Sort: bson.M{"createTime": -1},
|
|
|
+ }
|
|
|
+ return repo.RepoPageSearch(apictx.CreateRepoCtx(), option)
|
|
|
+ }
|
|
|
|
|
|
if query["matId"] != nil {
|
|
|
matId := query["matId"].(string)
|