zhangqian
2024-07-04 c950586b718ae6fc198bedf424609a4ac94cb5d1
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)
   }