From b90ad3946fdf84ccf9ad4d5d2e493e0e6c00b96a Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期四, 03 八月 2023 11:47:16 +0800
Subject: [PATCH] fix

---
 service/serviceFollowup.go |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/service/serviceFollowup.go b/service/serviceFollowup.go
index 8faea0b..c05a414 100644
--- a/service/serviceFollowup.go
+++ b/service/serviceFollowup.go
@@ -16,19 +16,6 @@
 	return ecode.OK
 }
 
-func (FollowupService) DeleteServiceFollowup(id int) int {
-	_, err := model.NewServiceFollowupSearch().SetId(id).Find()
-	if err != nil {
-		return ecode.ServiceFollowupNotExist
-	}
-
-	err = model.NewServiceFollowupSearch().SetId(id).Delete()
-	if err != nil {
-		return ecode.ServiceFollowupNotExist
-	}
-	return ecode.OK
-}
-
 func (FollowupService) UpdateServiceFollowup(serviceFollowup *model.ServiceFollowup) int {
 	// check serviceFollowup exist
 	_, err := model.NewServiceFollowupSearch().SetId(serviceFollowup.Id).Find()
@@ -52,3 +39,12 @@
 	}
 	return contacts, total, ecode.OK
 }
+
+func (FollowupService) DeleteServiceFollowup(ids []int) int {
+	// delete client
+	err := model.NewServiceFollowupSearch().SetIds(ids).Delete()
+	if err != nil {
+		return ecode.ServiceFollowupDeleteErr
+	}
+	return ecode.OK
+}

--
Gitblit v1.8.0