liujiandao
2023-10-13 5fa1de02759b9646e8987312736699755990e960
model/salesReturn.go
@@ -77,6 +77,9 @@
   if slf.SourceId != 0 {
      db = db.Where("source_id = ?", slf.SourceId)
   }
   if slf.ClientId != 0 {
      db = db.Where("client_id = ?", slf.ClientId)
   }
   if slf.Preload {
      db = db.Preload("Client").
         Preload("Member").
@@ -198,11 +201,17 @@
   slf.SourceType = sourceType
   return slf
}
func (slf *SalesReturnSearch) SetSourceId(sourceId int) *SalesReturnSearch {
   slf.SourceId = sourceId
   return slf
}
func (slf *SalesReturnSearch) SetClientId(clientId int) *SalesReturnSearch {
   slf.ClientId = clientId
   return slf
}
func (slf *SalesReturnSearch) UpdateByMap(data map[string]interface{}) error {
   var db = slf.build()
   return db.Updates(data).Error