From d2e6dff92184f2c6b9cff56ce04e2f11b8494672 Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期四, 13 六月 2024 11:37:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/jialian' into jialian
---
models/operation_type.go | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/models/operation_type.go b/models/operation_type.go
index 4857259..b206050 100644
--- a/models/operation_type.go
+++ b/models/operation_type.go
@@ -41,12 +41,13 @@
OperationTypeSearch struct {
OperationType
- Order string
- PageNum int
- PageSize int
- Keyword string
- Orm *gorm.DB
- Preload bool
+ Order string
+ PageNum int
+ PageSize int
+ Keyword string
+ Orm *gorm.DB
+ Preload bool
+ WarehouseIds []int
}
OperationTypeByStatus struct {
@@ -109,6 +110,11 @@
return slf
}
+func (slf *OperationTypeSearch) SetWarehouseIds(warehouseIds []int) *OperationTypeSearch {
+ slf.WarehouseIds = warehouseIds
+ return slf
+}
+
func (slf *OperationTypeSearch) build() *gorm.DB {
var db = slf.Orm.Model(&OperationType{})
@@ -136,6 +142,10 @@
db = db.Where("warehouse_id = ?", slf.WarehouseId)
}
+ if len(slf.WarehouseIds) > 0 {
+ db = db.Where("warehouse_id in ?", slf.WarehouseIds)
+ }
+
if int(slf.BaseOperationType) != 0 {
db = db.Where("base_operation_type = ?", slf.BaseOperationType)
}
--
Gitblit v1.8.0