From cd9a3c446cff66e589cdb26163c3e2baf4bc6a1e Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 30 八月 2023 13:37:19 +0800
Subject: [PATCH] fix
---
service/serviceFollowup.go | 39 +++++++++++++++++++++------------------
1 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/service/serviceFollowup.go b/service/serviceFollowup.go
index 579c73d..46c52c9 100644
--- a/service/serviceFollowup.go
+++ b/service/serviceFollowup.go
@@ -1,6 +1,7 @@
package service
import (
+ "aps_crm/constvar"
"aps_crm/model"
"aps_crm/pkg/ecode"
)
@@ -13,19 +14,6 @@
return ecode.ServiceFollowupExist
}
- 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
}
@@ -44,11 +32,26 @@
return ecode.OK
}
-func (FollowupService) GetServiceFollowupList(page, pageSize int, keyword string) ([]*model.ServiceFollowup, int) {
- // get contact list
- contacts, err := model.NewServiceFollowupSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll()
+func (FollowupService) DeleteServiceFollowup(ids []int) int {
+ // delete client
+ err := model.NewServiceFollowupSearch().SetIds(ids).Delete()
if err != nil {
- return nil, ecode.ServiceFollowupListErr
+ return ecode.ServiceFollowupDeleteErr
}
- return contacts, ecode.OK
+ return ecode.OK
+}
+
+func (FollowupService) GetServiceFollowupList(page, pageSize int, keywordType constvar.ServiceFollowupKeywordType, keyword string, serviceOrderId int) ([]*model.ServiceFollowup, int64, int) {
+ // get contact list
+ contacts, total, err := model.NewServiceFollowupSearch().
+ SetKeywordType(keywordType).
+ SetKeyword(keyword).
+ SetPage(page, pageSize).
+ SetPreload(true).
+ SetServiceOrderId(serviceOrderId).
+ FindAll()
+ if err != nil {
+ return nil, 0, ecode.ServiceFollowupListErr
+ }
+ return contacts, total, ecode.OK
}
--
Gitblit v1.8.0