From e1c0fe2768d32f79920ceda92383981d4ff12058 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期五, 15 三月 2024 10:07:50 +0800
Subject: [PATCH] 获取销售明细产品信息

---
 service/quotation.go |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/service/quotation.go b/service/quotation.go
index ede0edc..3f32563 100644
--- a/service/quotation.go
+++ b/service/quotation.go
@@ -9,6 +9,15 @@
 type QuotationService struct{}
 
 func (QuotationService) AddQuotation(quotation *model.Quotation) int {
+	//鏍规嵁閿�鍞満浼歩d鍘绘煡璇㈠鎴穒d
+	if quotation.ClientId == 0 {
+		record, err := model.NewSaleChanceSearch().SetId(quotation.SaleChanceId).Find()
+		if err != nil {
+			return ecode.SaleChanceNotExist
+		}
+		quotation.ClientId = record.ClientId
+		quotation.ContactId = record.ContactId
+	}
 	err := model.NewQuotationSearch(nil).Create(quotation)
 	if err != nil {
 		return ecode.QuotationExist

--
Gitblit v1.8.0