zhangqian
2024-03-19 e5a48de88081f1fe0e5250a6e147c392d22acd4b
model/salesDetailsProduct.go
@@ -42,6 +42,9 @@
   if len(slf.ProductIds) > 0 {
      db = db.Where("product_id in (?)", slf.ProductIds)
   }
   if slf.SalesDetailsId != 0 {
      db = db.Where("sales_details_id = ?", slf.SalesDetailsId)
   }
   return db
}
@@ -51,6 +54,11 @@
   return slf
}
func (slf *SalesDetailsProductSearch) SetSalesDetailsId(id int) *SalesDetailsProductSearch {
   slf.SalesDetailsId = id
   return slf
}
func (slf *SalesDetailsProductSearch) Create(record *SalesDetailsProduct) error {
   var db = slf.build()
   return db.Create(record).Error