From eb65f4c3c6903b11424eeaefe46653acedf24448 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期二, 08 八月 2023 09:40:22 +0800 Subject: [PATCH] Merge branch 'master' into fly --- service/serviceFollowup.go | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/service/serviceFollowup.go b/service/serviceFollowup.go index 8faea0b..bdcb710 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,9 +32,21 @@ return ecode.OK } -func (FollowupService) GetServiceFollowupList(page, pageSize int, keyword string) ([]*model.ServiceFollowup, int64, int) { +func (FollowupService) DeleteServiceFollowup(ids []int) int { + // delete client + err := model.NewServiceFollowupSearch().SetIds(ids).Delete() + if err != nil { + return ecode.ServiceFollowupDeleteErr + } + return ecode.OK +} + +func (FollowupService) GetServiceFollowupList(page, pageSize int, keywordType constvar.ServiceFollowupKeywordType, keyword string) ([]*model.ServiceFollowup, int64, int) { // get contact list - contacts, total, err := model.NewServiceFollowupSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + contacts, total, err := model.NewServiceFollowupSearch(). + SetKeywordType(keywordType). + SetKeyword(keyword). + SetPage(page, pageSize).FindAll() if err != nil { return nil, 0, ecode.ServiceFollowupListErr } -- Gitblit v1.8.0