From 221108b0e0416968ca8417513ebf65c8b5109662 Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期三, 26 六月 2024 11:40:47 +0800
Subject: [PATCH] 库存盘点应用按钮记录创建人,创建时间,应用时间、应用人员等信息;根据条形码查询产品详情;新增编辑产品增加条形码字段->添加条形码被使用验证
---
models/attribute_value.go | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/models/attribute_value.go b/models/attribute_value.go
index 960685d..fc6e42a 100644
--- a/models/attribute_value.go
+++ b/models/attribute_value.go
@@ -17,6 +17,7 @@
AttributeValueSearch struct {
AttributeValue
+ Ids []string
Order string
PageNum int
PageSize int
@@ -55,6 +56,10 @@
slf.EntityID = entityId
return slf
}
+func (slf *AttributeValueSearch) SetEntityIDs(entityId []string) *AttributeValueSearch {
+ slf.Ids = entityId
+ return slf
+}
func (slf *AttributeValueSearch) SetAttributeID(attributeId uint) *AttributeValueSearch {
slf.AttributeID = attributeId
return slf
@@ -78,7 +83,9 @@
if slf.Value != "" {
db = db.Where("value like ?", "%"+slf.Value+"%")
}
-
+ if len(slf.Ids) > 0 {
+ db = db.Where("entity_id in ?", slf.Ids)
+ }
if slf.Order != "" {
db = db.Order(slf.Order)
}
--
Gitblit v1.8.0