liujiandao
2023-11-13 1dd416deaf053a23a56b42a1ab18fe9f621fefb0
models/location.go
@@ -38,6 +38,7 @@
      Orm        *gorm.DB
      Preload    bool
      JointNames []string
      Ids        []int
   }
)
@@ -66,6 +67,11 @@
func (slf *LocationSearch) SetID(ID int) *LocationSearch {
   slf.Id = ID
   return slf
}
func (slf *LocationSearch) SetIds(ids []int) *LocationSearch {
   slf.Ids = ids
   return slf
}
@@ -116,6 +122,10 @@
      db = db.Where("id = ?", slf.Id)
   }
   if len(slf.Ids) > 0 {
      db = db.Where("id in (?)", slf.Ids)
   }
   if slf.Order != "" {
      db = db.Order(slf.Order)
   }