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 }