models/location_product_amount.go
@@ -36,6 +36,7 @@ ProductIds []string Ids []int Query string Fields string } LocationProductAmountWithOperation struct { @@ -131,6 +132,11 @@ return slf } func (slf *LocationProductAmountSearch) SetFields(fields string) *LocationProductAmountSearch { slf.Fields = fields return slf } func (slf *LocationProductAmountSearch) build() *gorm.DB { var db = slf.Orm.Model(&LocationProductAmount{}) @@ -181,6 +187,10 @@ db = db.Where("warehouse_id = ?", slf.WarehouseId) } if slf.Fields != "" { db = db.Select(slf.Fields) } return db }