jiangshuai
2023-10-20 222399d441e1a759bae2a10685245ee90bc3fb6d
models/location_product_amount.go
@@ -20,12 +20,13 @@
   LocationProductAmountSearch struct {
      LocationProductAmount
      Order    string
      PageNum  int
      PageSize int
      Keyword  string
      Orm      *gorm.DB
      Preload  bool
      Order              string
      PageNum            int
      PageSize           int
      Keyword            string
      Orm                *gorm.DB
      Preload            bool
      LocationProductIds []int
   }
   LocationProductAmountWithOperation struct {
@@ -88,6 +89,11 @@
   return slf
}
func (slf *LocationProductAmountSearch) SetLocationProductIds(ids []int) *LocationProductAmountSearch {
   slf.LocationProductIds = ids
   return slf
}
func (slf *LocationProductAmountSearch) build() *gorm.DB {
   var db = slf.Orm.Model(&LocationProductAmount{})
@@ -108,6 +114,9 @@
   if slf.LocationProductId != 0 {
      db = db.Where("location_product_id=?", slf.LocationProductId)
   }
   if len(slf.LocationProductIds) > 0 {
      db = db.Where("location_product_id in (?)", slf.LocationProductIds)
   }
   return db
}