From 1e1eff926a1a331f29b225a41343fd9ecb01fe66 Mon Sep 17 00:00:00 2001 From: yinbentan <yinbentan@live.com> Date: 星期二, 16 七月 2024 20:19:50 +0800 Subject: [PATCH] 添加字段,嘉联仓储添加 SilkMarket(庄口)、SilkMarketClose(庄口是否关闭)字段 --- controllers/operation_type.go | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/controllers/operation_type.go b/controllers/operation_type.go index 247562f..cf07e2f 100644 --- a/controllers/operation_type.go +++ b/controllers/operation_type.go @@ -7,6 +7,7 @@ "github.com/spf13/cast" "gorm.io/gorm" "strconv" + "strings" "wms/constvar" "wms/extend/code" "wms/extend/util" @@ -116,11 +117,21 @@ util.ResponseFormat(c, code.RequestParamError, err.Error()) return } + warehouseIds := make([]int, 0) + if "" != params.WarehouseIds { + for _, strId := range strings.Split(params.WarehouseIds, ",") { + intId, err := strconv.Atoi(strId) + if err != nil { + util.ResponseFormat(c, code.RequestParamError, err.Error()) + } + warehouseIds = append(warehouseIds, intId) + } + } list, total, err := models.NewOperationTypeSearch(). SetPage(params.Page, params.PageSize). SetKeyword(params.Keyword). SetOrder("id desc"). - SetWarehouseIds(params.WarehouseIds). + SetWarehouseIds(warehouseIds). SetPreload(true).Find() if err != nil { util.ResponseFormat(c, code.RequestError, "鏌ユ壘澶辫触") -- Gitblit v1.8.0