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