liujiandao
2023-10-12 17aaed743ab7a3520ec8eb9e4ab7c776ca807cdd
model/salesReturn.go
@@ -71,7 +71,12 @@
   if len(slf.Ids) != 0 {
      db = db.Where("id in ?", slf.Ids)
   }
   if slf.SourceType != 0 {
      db = db.Where("source_type = ?", slf.SourceType)
   }
   if slf.SourceId != 0 {
      db = db.Where("source_id = ?", slf.SourceId)
   }
   if slf.Preload {
      db = db.Preload("Client").
         Preload("Member").
@@ -189,6 +194,14 @@
   slf.Preload = preload
   return slf
}
func (slf *SalesReturnSearch) SetSourceType(sourceType constvar.SalesReturnSourceType) *SalesReturnSearch {
   slf.SourceType = sourceType
   return slf
}
func (slf *SalesReturnSearch) SetSourceId(sourceId int) *SalesReturnSearch {
   slf.SourceId = sourceId
   return slf
}
func (slf *SalesReturnSearch) UpdateByMap(data map[string]interface{}) error {
   var db = slf.build()