models/location_product_amount.go
@@ -36,6 +36,7 @@ LocationIds []int ProductIds []string Ids []int Query string } LocationProductAmountWithOperation struct { @@ -119,6 +120,11 @@ return slf } func (slf *LocationProductAmountSearch) SetQuery(query string) *LocationProductAmountSearch { slf.Query = query return slf } func (slf *LocationProductAmountSearch) build() *gorm.DB { var db = slf.Orm.Model(&LocationProductAmount{}) @@ -163,6 +169,10 @@ db = db.Where("id in (?)", slf.Ids) } if slf.Query != "" { db = db.Where(slf.Query) } return db }