fix
wangpengfei
2023-08-15 10ca8371ece3ea79297dab05d486ae112da7b46a
model/contract.go
@@ -9,7 +9,9 @@
   Contract struct {
      Id          int       `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
      ClientId    int       `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"`
      Client      Client    `json:"client" gorm:"foreignKey:ClientId"`
      MemberId    int       `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"`
      Member      User      `json:"member" gorm:"foreignKey:MemberId"`
      Number      string    `json:"number" gorm:"column:number;type:varchar(255);comment:合同编号"`
      QuotationId int       `json:"quotationId" gorm:"column:quotation_id;type:int;comment:报价单id"`
      Quotation   Quotation `json:"quotation" gorm:"foreignKey:QuotationId;references:Id"`
@@ -110,7 +112,7 @@
      db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
   }
   err := db.Preload("Quotation").Order("id desc").Find(&records).Error
   err := db.Preload("Client").Preload("Member").Preload("Quotation").Order("id desc").Find(&records).Error
   return records, total, err
}