liujiandao
2023-10-24 d8c708a30d938ceb87348257add9dc10926044df
model/salesRefund.go
@@ -16,8 +16,8 @@
      Client        Client                    `json:"client" gorm:"foreignKey:ClientId"`
      Number        string                    `json:"number" gorm:"column:number;type:varchar(255);comment:退款单号"`
      SourceType    constvar.RefundSourceType `gorm:"column:source_type;type:int;not null;default 0;comment:来源类型(1销售退货)" json:"sourceType"` // 来源类型(1销售退货)
      SourceId      int                       `gorm:"column:source_id;type:int;not null;default 0;comment:源单id " json:"sourceId"`           // 源单id
      Source        SalesReturn               `gorm:"foreignKey:SourceId" json:"Source"`
      SalesReturnId int                       `gorm:"column:source_id;type:int;not null;default 0;comment:源单id " json:"sourceId"`           // 源单id
      SalesReturn   SalesReturn               `gorm:"foreignKey:SalesReturnId" json:"salesReturn"`
      MemberId      int                       `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"`
      Member        User                      `json:"member" gorm:"foreignKey:MemberId"`
      RefundDate    string                    `json:"refundDate" gorm:"column:refund_date;type:varchar(255);comment:退款日期"`
@@ -78,16 +78,16 @@
      db = db.Where("source_type = ?", slf.SourceType)
   }
   if slf.SourceId != 0 {
      db = db.Where("source_id = ?", slf.SourceId)
   if slf.SalesReturnId != 0 {
      db = db.Where("source_id = ?", slf.SalesReturnId)
   }
   if slf.Preload {
      db = db.Preload("Client").
         Preload("PaymentType").
         Preload("BankAccount").
         Preload("Source").
         Preload("Products")
         Preload("Products").
         Preload("SalesReturn")
   }
   if slf.KeywordType != "" {
      switch slf.KeywordType {
@@ -212,7 +212,7 @@
}
func (slf *SalesRefundSearch) SetSourceId(id int) *SalesRefundSearch {
   slf.SourceId = id
   slf.SalesReturnId = id
   return slf
}