From b3a318b7f707ca49fa9127881bbe709654eaa761 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期三, 27 九月 2023 17:27:51 +0800
Subject: [PATCH] 报表功能开发

---
 models/operation_details.go |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/models/operation_details.go b/models/operation_details.go
index 32e8f9a..9e89e77 100644
--- a/models/operation_details.go
+++ b/models/operation_details.go
@@ -74,6 +74,11 @@
 	return slf
 }
 
+func (slf *OperationDetailsSearch) SetProductId(productId string) *OperationDetailsSearch {
+	slf.ProductId = productId
+	return slf
+}
+
 func (slf *OperationDetailsSearch) build() *gorm.DB {
 	var db = slf.Orm.Model(&OperationDetails{})
 
@@ -92,6 +97,9 @@
 	if slf.OperationID != 0 {
 		db = db.Where("operation_id = ?", slf.OperationID)
 	}
+	if slf.ProductId != "" {
+		db = db.Where("product_id = ?", slf.ProductId)
+	}
 
 	return db
 }

--
Gitblit v1.8.0