From 01ad3ec7bec1800023fcca1048c23bb1229f38a8 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期五, 18 八月 2023 11:48:57 +0800
Subject: [PATCH] fix

---
 model/quotation.go         |    2 +-
 api/v1/quotation.go        |    1 +
 model/request/quotation.go |   20 ++++++++++----------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/api/v1/quotation.go b/api/v1/quotation.go
index 8f8a4f4..a99f69a 100644
--- a/api/v1/quotation.go
+++ b/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
 
diff --git a/model/quotation.go b/model/quotation.go
index 68a0df0..6bd3f8b 100644
--- a/model/quotation.go
+++ b/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
 }
 
diff --git a/model/request/quotation.go b/model/request/quotation.go
index ec532c8..468b1fb 100644
--- a/model/request/quotation.go
+++ b/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 {

--
Gitblit v1.8.0