From 06c0b03df2955475fe39ff2a793a5f151f4da99f Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期四, 17 八月 2023 19:25:30 +0800
Subject: [PATCH] Merge branch 'master' into fly

---
 api/v1/client.go |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/api/v1/client.go b/api/v1/client.go
index c4da6b7..b354d14 100644
--- a/api/v1/client.go
+++ b/api/v1/client.go
@@ -99,16 +99,16 @@
 	client.Business.EnterpriseScaleId = params.EnterpriseScaleId
 	client.MemberId = params.MemberId
 
-	if params.Contact.Name != "" {
-		// assign the client's member id to contact when adding
-		params.Contact.MemberId = params.MemberId
+	//if params.Contact.Name != "" {
+	// assign the client's member id to contact when adding
+	params.Contact.MemberId = params.MemberId
 
-		errCode, contact := checkContactParams(params.Contact)
-		if errCode != ecode.OK {
-			return errCode, nil
-		}
-		client.Contacts = []model.Contact{contact}
+	errCode, contact := checkContactParams(params.Contact)
+	if errCode != ecode.OK {
+		return errCode, nil
 	}
+	client.Contacts = []model.Contact{contact}
+	//}
 
 	return ecode.OK, client
 }
@@ -166,7 +166,7 @@
 
 	client.Id = params.Id
 
-	errCode = clientService.UpdateClient(client)
+	errCode = clientService.UpdateClient(client, params.ContactId)
 	if errCode != ecode.OK {
 		ctx.Fail(errCode)
 		return

--
Gitblit v1.8.0