From 2baa7bad0482613829e217997c44a51d8ec0ec66 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期三, 20 九月 2023 09:51:58 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS

---
 models/operation_details.go |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/models/operation_details.go b/models/operation_details.go
index f7b5479..6792f45 100644
--- a/models/operation_details.go
+++ b/models/operation_details.go
@@ -12,9 +12,8 @@
 	OperationDetails struct {
 		WmsModel
 
-		Id          int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
-		OperationId int `json:"OperationId" gorm:"type:int;not null;comment:鎿嶄綔璁板綍id"` //鎿嶄綔id
-
+		Id             int             `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
+		OperationId    int             `json:"OperationId" gorm:"type:int;not null;comment:鎿嶄綔璁板綍id"`          //鎿嶄綔id
 		ProductId      int             `json:"productId" gorm:"type:int;not null;comment:浜у搧id"`              //浜у搧id
 		ProductName    string          `json:"productName" gorm:"type:varchar(255);not null;comment:浜у搧鍚嶇О"`   //浜у搧鍚嶇О
 		Quantity       decimal.Decimal `json:"quantity" gorm:"type:decimal(20,2);not null;comment:鏁伴噺"`       //鏁伴噺
@@ -70,6 +69,11 @@
 	return slf
 }
 
+func (slf *OperationDetailsSearch) SetOperationId(operationId int) *OperationDetailsSearch {
+	slf.OperationId = operationId
+	return slf
+}
+
 func (slf *OperationDetailsSearch) build() *gorm.DB {
 	var db = slf.Orm.Model(&OperationDetails{})
 
@@ -85,6 +89,10 @@
 		db = db.Where("product_name like ?", fmt.Sprintf("%%%v%%", slf.Keyword))
 	}
 
+	if slf.OperationId != 0 {
+		db = db.Where("operation_id = ?", slf.OperationId)
+	}
+
 	return db
 }
 

--
Gitblit v1.8.0