From 378353b4c37e52da3c99f10ff3a1c9078a71b3bd Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期五, 11 八月 2023 11:42:48 +0800
Subject: [PATCH] temp

---
 model/quotation.go         |    8 ++++----
 model/request/quotation.go |   21 ++++++++++++---------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/model/quotation.go b/model/quotation.go
index 2999797..5bb7078 100644
--- a/model/quotation.go
+++ b/model/quotation.go
@@ -16,12 +16,13 @@
 		ValidityDate      time.Time  `json:"validity_date" gorm:"column:validity_date;type:datetime;comment:鏈夋晥鏈�"`
 		ContactId         int        `json:"contact_id" gorm:"column:contact_id;type:int;comment:鑱旂郴浜篿d"`
 		MemberId          int        `json:"member_id" gorm:"column:member_id;type:int;comment:璐熻矗浜篿d"`
-		SaleChanceId      int        `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int;comment:鍟嗘満id"`
+		SaleChanceId      int        `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int;comment:閿�鍞満浼歩d"`
 		Conditions        string     `json:"conditions" gorm:"column:conditions;type:text;comment:鎶ヤ环鏉′欢"`
 		File              string     `json:"file" gorm:"column:file;type:varchar(255);comment:闄勪欢"`
 		Client            Client     `json:"client" gorm:"foreignKey:ClientId"`
 		Contact           Contact    `json:"contact" gorm:"foreignKey:ContactId"`
 		SaleChance        SaleChance `json:"sale_chance" gorm:"foreignKey:SaleChanceId"`
+		Products          []Product  `json:"products" gorm:"many2many:quotation_product"`
 		gorm.Model        `json:"-"`
 	}
 
@@ -29,12 +30,11 @@
 	QuotationSearch struct {
 		Quotation
 
-				Orm      *gorm.DB
+		Orm      *gorm.DB
 		Keyword  string
 		OrderBy  string
 		PageNum  int
 		PageSize int
-
 	}
 )
 
@@ -120,4 +120,4 @@
 func (slf *QuotationSearch) SetOrder(order string) *QuotationSearch {
 	slf.OrderBy = order
 	return slf
-}
\ No newline at end of file
+}
diff --git a/model/request/quotation.go b/model/request/quotation.go
index 8ee6098..f996a4c 100644
--- a/model/request/quotation.go
+++ b/model/request/quotation.go
@@ -1,19 +1,22 @@
 package request
 
+import "aps_crm/model"
+
 type AddQuotation struct {
 	Quotation
 }
 
 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"`
+	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