From 80c8e74c7428329f06d1aa3b70b95b46da732b0a Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 27 六月 2024 20:09:03 +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