| | |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | list, total, err := models.NewOperationTypeSearch().SetPage(params.Page, params.PageSize).SetKeyword(params.Keyword).SetOrder("id desc").SetPreload(true).Find() |
| | | list, total, err := models.NewOperationTypeSearch(). |
| | | SetPage(params.Page, params.PageSize). |
| | | SetKeyword(params.Keyword). |
| | | SetOrder("id desc"). |
| | | SetWarehouseId(params.WarehouseId). |
| | | SetPreload(true).Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestError, "查找失败") |
| | | return |
| | |
| | | list[k].FinishCount = value.Count |
| | | } |
| | | if value, ok := mapStatistics[strconv.Itoa(v.Id)+string(constvar.OperationStatus_Cancel)]; ok { |
| | | list[k].FinishCount = value.Count |
| | | list[k].CancelCount = value.Count |
| | | } |
| | | } |
| | | util.ResponseFormatListWithPage(c, code.Success, list, cast.ToInt(total), params.Page, params.PageSize) |