fix
wangpengfei
2023-08-18 01ad3ec7bec1800023fcca1048c23bb1229f38a8
fix

fix preload products of quotation
3个文件已修改
23 ■■■■ 已修改文件
api/v1/quotation.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/quotation.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/quotation.go 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/quotation.go
@@ -139,6 +139,7 @@
    quotationModel.ContactId = quotation.ContactId
    quotationModel.Conditions = quotation.Conditions
    quotationModel.File = quotation.File
    quotationModel.Products = quotation.Products
    return ecode.OK, quotationModel
model/quotation.go
@@ -119,7 +119,7 @@
        db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
    }
    err := db.Preload("Member").Preload("QuotationStatus").Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error
    err := db.Preload("Products").Preload("Member").Preload("QuotationStatus").Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error
    return records, total, err
}
model/request/quotation.go
@@ -7,16 +7,16 @@
}
type Quotation struct {
    ClientId          int              `json:"client_id"`
    Number            string           `json:"number"`
    QuotationStatusId int              `json:"quotation_status_id"`
    ValidityDate      string           `json:"validity_date"`
    ContactId         int              `json:"contact_id"`
    MemberId          int              `json:"member_id"`
    SaleChanceId      int              `json:"sale_chance_id"`
    Conditions        string           `json:"conditions"`
    File              string           `json:"file"`
    Products          []*model.Product `json:"products"`
    ClientId          int             `json:"client_id"`
    Number            string          `json:"number"`
    QuotationStatusId int             `json:"quotation_status_id"`
    ValidityDate      string          `json:"validity_date"`
    ContactId         int             `json:"contact_id"`
    MemberId          int             `json:"member_id"`
    SaleChanceId      int             `json:"sale_chance_id"`
    Conditions        string          `json:"conditions"`
    File              string          `json:"file"`
    Products          []model.Product `json:"products"`
}
type UpdateQuotation struct {