|
@@ -176,13 +176,22 @@ func GetProduceBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
func GetProduceBills(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
|
|
|
page, size, query := UtilQueryPageSize(c)
|
|
|
+ sort := "createTime"
|
|
|
+ if v, ok := query["sort"]; ok {
|
|
|
+ if _sort, ok := v.(string); ok {
|
|
|
+ if len(_sort) > 0 {
|
|
|
+ sort = _sort
|
|
|
+ }
|
|
|
+ }
|
|
|
+ delete(query, "sort")
|
|
|
+ }
|
|
|
|
|
|
option := &repo.PageSearchOptions{
|
|
|
CollectName: repo.CollectionBillProduce,
|
|
|
Query: makeBillQuery(query),
|
|
|
Page: page,
|
|
|
Size: size,
|
|
|
- Sort: bson.M{"createTime": -1},
|
|
|
+ Sort: bson.M{sort: -1},
|
|
|
}
|
|
|
return repo.RepoPageSearch(apictx.CreateRepoCtx(), option)
|
|
|
}
|