From 8397fb4c46d08d0332300f9fde1e7b3eb04845fe Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期六, 23 三月 2024 14:00:12 +0800 Subject: [PATCH] srm查询入库单 --- models/warehouse.go | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/models/warehouse.go b/models/warehouse.go index 8e8a779..5832dd7 100644 --- a/models/warehouse.go +++ b/models/warehouse.go @@ -27,6 +27,7 @@ OutboundTransportation int `json:"outboundTransportation" gorm:"type:int;comment:鍑哄簱杩愯緭"` //鍑哄簱杩愯緭 LocationId int `json:"locationId" gorm:"type:int;comment:浣嶇疆id"` //浣嶇疆id WarehouseLocation string `json:"warehouseLocation" gorm:"-"` //搴撳瓨浣嶇疆 + Contacts string `json:"contacts" gorm:"type:varchar(255);comment:鑱旂郴浜�"` //鑱旂郴浜� } WarehouseSearch struct { @@ -37,6 +38,7 @@ Keyword string Orm *gorm.DB Preload bool + Codes []string } ) @@ -78,6 +80,11 @@ return slf } +func (slf *WarehouseSearch) SetCodes(codes []string) *WarehouseSearch { + slf.Codes = codes + return slf +} + func (slf *WarehouseSearch) SetName(name string) *WarehouseSearch { slf.Name = name return slf @@ -115,10 +122,15 @@ if slf.Preload { db = db.Preload("Company") } + if slf.Code != "" { db = db.Where("code = ?", slf.Code) } + if len(slf.Codes) > 0 { + db = db.Where("code in ?", slf.Codes) + } + return db } -- Gitblit v1.8.0